-
-
Notifications
You must be signed in to change notification settings - Fork 323
Birmingham | 26-ITP-May | Tobias Amaechina | Sprint 2 | debug #1315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Tobias-Amaechina
wants to merge
49
commits into
CodeYourFuture:main
Choose a base branch
from
Tobias-Amaechina:group-data-sprint-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
b27b10f
predicted and explaint what will happen
Tobias-Amaechina f017ce1
fix the bracket notation to access the key property of the onject an…
Tobias-Amaechina e5e37a2
made a prediction with my reason on what will happen when the progra…
Tobias-Amaechina ae5347b
I used for ..in and bracket notation to access the properties value …
Tobias-Amaechina d8493ef
made my prediction as to what will happen when the program runs and…
Tobias-Amaechina 01748e7
used for .. of to iterate over the aray elemnts in the ingredient an…
Tobias-Amaechina 2e7ce33
Wrote a test to check for property name in given object and return t…
Tobias-Amaechina 0ace00d
implements a function to pass the test
Tobias-Amaechina bd7b8a3
Wrote a test to check for name property from an empty array and retu…
Tobias-Amaechina 7995cac
Re-write the General acceptance criteria to a separate test for when…
Tobias-Amaechina d0d5b6c
Wrote a test to return false when invalid parameters like array are p…
Tobias-Amaechina 105c0e7
wrote a test check and return false when string is passed
Tobias-Amaechina 931be76
Wrote a test to check and return false when invalid parameter like nu…
Tobias-Amaechina 96db9d3
commented out the test.todo
Tobias-Amaechina e07fc92
wrote a test suite to check for multiple array , empty array and sing…
Tobias-Amaechina c6fad45
Implemented a function to pass the test of country and currency code
Tobias-Amaechina 311f34a
refatored the consitional statement to check for empty string ,also …
Tobias-Amaechina 502af08
repaced the occurence of plus sign with spaces
Tobias-Amaechina 1e8578b
separated the key, value at the first occurance of "="
Tobias-Amaechina 4ea0c56
replace const with let to allow for reassigment in the for .. of loop…
Tobias-Amaechina a404823
created an empty array
Tobias-Amaechina a76b2fd
declare the items vatiable and validate if it has anything at all
Tobias-Amaechina 2ebe778
Validate the inpute data corectly with the correct name to ensure the…
Tobias-Amaechina 30b4cdd
declare the variable frequency an assign it empty object
Tobias-Amaechina 8c60483
wrote the test suite for the test cases
Tobias-Amaechina 5683e38
answered the first question a
Tobias-Amaechina 1760ba2
answered the questin for b
Tobias-Amaechina 55dd8a5
gave the correct response for the question a
Tobias-Amaechina 0b3d681
answered question about what the target return should be
Tobias-Amaechina 7757d5f
Answered question on what Object.entries does
Tobias-Amaechina 82dbb8a
Answered the question for d
Tobias-Amaechina 2d3c86d
fixed the implementation to invert the returned value
Tobias-Amaechina 4de7d6b
implemented the function
Tobias-Amaechina e75e0c5
created an empty file invert.test.js
Tobias-Amaechina 61b2205
deleted the console.assert and exported the function invert
Tobias-Amaechina d50ad7f
wrote a test to passed the implemetion
Tobias-Amaechina f350f5e
removed the second tally.js file import from the tall.test.js file
Tobias-Amaechina 3985d77
Declare a function with a name countWords
Tobias-Amaechina b6d6732
give the function declaration a parameter and validate that it's a s…
Tobias-Amaechina 9f5ff0b
use regex to replace any puncuations with empty string
Tobias-Amaechina bc5e948
split the cleanedStr and filler words that passed the condition
Tobias-Amaechina 5940b72
ordered the words by sorting them
Tobias-Amaechina e4257fc
Refactored the code to have two stages ! to track frequency of each …
Tobias-Amaechina 1dcd83a
Answered the quest a
Tobias-Amaechina 73823dc
Answere question b
Tobias-Amaechina 62439d4
Answered question c what the calculation evaluated to inside the for …
Tobias-Amaechina 7ecfd73
Wrote a test to check if the implementation worked
Tobias-Amaechina 7a9a51d
Implement the function to pass the test
Tobias-Amaechina 03af002
refactored the function tally
Tobias-Amaechina File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,10 @@ | ||
| function contains() {} | ||
|
|
||
| function contains(obj, target) { | ||
| for (const key in obj) { | ||
| if (key === target) return true; | ||
| } | ||
| return false; | ||
| } | ||
|
|
||
|
|
||
| module.exports = contains; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,12 @@ | ||
| function tally() {} | ||
| function tally(items) { | ||
| if (!Array.isArray(items)) { | ||
| throw new Error("Input must be an array"); | ||
| } | ||
|
|
||
| const frequency = {}; | ||
| for (const item of items) { | ||
| frequency[item] = (frequency[item] || 0) + 1; | ||
| } | ||
| return frequency; | ||
| } | ||
| module.exports = tally; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
|
|
||
|
|
||
| const invert = require("./invert.js"); | ||
|
|
||
| test("swaps keys and values for a simple object", () => { | ||
| const input = { x: 10, y: 20 }; | ||
| const output = invert(input); | ||
| expect(output).toEqual({ 10: "x", 20: "y" }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of destructuring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback