generated from CodeYourFuture/Module-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 207
Sheffield | May-2025 | Waleed- Salih-Taha | Sprint 2 | Data Group #672
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
Closed
Closed
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
1977a31
predicted and explained the out put of the code. and the reasons.
Bluejay600 eebd015
fixed the code and tested the result.
Bluejay600 71bf7b5
predicted the out put
Bluejay600 7500e6d
explained why the 'for ...of' loop is not iterating over the object.
Bluejay600 bb5539d
fixed annd corrected the code.
Bluejay600 a021930
predicted the out put and explained the code.
Bluejay600 980a5a7
fixed the code using 'join('\n')' on the ingrediants array.
Bluejay600 a518149
edited the tile ones again.
Bluejay600 7d3267f
updated the author.js file.
Bluejay600 fea80a6
implemented contains function.
Bluejay600 c26f8a2
implemented test when contains on empty object returns false.
Bluejay600 ae304c5
implemented test contains on object with existing property returns true.
Bluejay600 906f106
implemented a test when contains on object with non-existent property…
Bluejay600 8fce11a
implemented a test when contains on array returns false.
Bluejay600 1a627a2
implemented a test when contains on array returns false.
Bluejay600 53feb2e
edited the contains function in contains.js
Bluejay600 7bd8faa
implemented a lookup function .
Bluejay600 e989993
removed unwanted space
Bluejay600 d71ddea
added a test to parses querystring with multiple values.
Bluejay600 2bd6525
added more edge cases to the test.
Bluejay600 660818b
fixed test parses querystring with single value.
Bluejay600 541987d
fixed some tests after runing the test.
Bluejay600 1ca501f
deleted one test.
Bluejay600 521a882
implemented the function for tally that except only array input.
Bluejay600 39eee0c
Edited the given todo test for tally on an empty array returns an emp…
Bluejay600 63d810b
implemented a test to tally on an array with duplicates returns corre…
Bluejay600 cf316cd
implemented a test for tally throws an error for non-array input
Bluejay600 091f560
interpreted all the questions in the invert.js.
Bluejay600 41da9c9
fixed the implementation of invert.
Bluejay600 6e14892
added the the module.experts= invert; at the last line.
Bluejay600 31426cd
created a new file test.js to write the test code in it for the inver…
Bluejay600 0e06b4f
implemented a function in the test.js file to Help function to compar…
Bluejay600 071aaf5
added some test cases for the function.
Bluejay600 b7ea301
added the console.log code to test my outputs.
Bluejay600 4bf8565
deleted the test file after testing for it gives undefiend result.
Bluejay600 677b56d
added five test cases to for the function created.
Bluejay600 9c357bd
deleted all the changes in the mode.js and mode.test.js
Bluejay600 417a3df
Wrote a function called countWords that takes a string as an argument…
Bluejay600 24a64ca
added console.log statement to test the function's results.
Bluejay600 b23ddc3
answered the frist till.js question what is the target output?.
Bluejay600 c2610ef
answered Why do we need to use Object.entries inside the for...of loo…
Bluejay600 5e9c886
answered What does coin * quantity evaluate to inside for loop.
Bluejay600 f7c9b83
Fixed the totaltill function implementation.
Bluejay600 9fda945
1. Edited the return value code to Object.hasOwn(obj, key).
Bluejay600 25c480d
made the code clearer, by destructure using Object.entries
Bluejay600 3ef6ee4
edited the function countwords to throw an error if input is string.
Bluejay600 692ca81
changed code to remove punctuation unsing regex and convert to lowcase.
Bluejay600 f50f79d
added optional code to Sort the results by frequency.
Bluejay600 0dde848
added some more examples for testing count-words.js.
Bluejay600 10af95b
reverted the changes in the quote generator.
Bluejay600 377da8e
added a robust parseQueryString implementation that passes your tests
Bluejay600 9cfaa3d
added Split by & and filter out empty chunks (but keep cases like '=')
Bluejay600 7238ca1
fixed the implementation of the function.
Bluejay600 9ec23cb
updated code
Bluejay600 93a7fa7
deleted unwanted code
Bluejay600 79fe12d
updated the js file code.
Bluejay600 8f4d096
updated function implementations.
Bluejay600 0e6590f
Merge branch 'main' into coursework_Sprint-2
Bluejay600 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,8 @@ | ||
| function contains() {} | ||
| function contains(obj, key) { | ||
| if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) { | ||
| return false; | ||
| } | ||
| return Object.hasOwn(obj, key); | ||
| } | ||
|
|
||
| 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,17 @@ | ||
| function createLookup() { | ||
| function createLookup(pairs) { | ||
| // implementation here | ||
| if (!Array.isArray(pairs)) { | ||
| throw new Error("Input must be an array of [key, value] pairs"); | ||
| } | ||
|
|
||
| return pairs.reduce((acc, pair) => { | ||
| if (!Array.isArray(pair) || pair.length !== 2) { | ||
| throw new Error("Each item must be an array with exactly 2 elements"); | ||
| } | ||
| const [countryCode, currencyCode] = pair; | ||
| acc[countryCode] = currencyCode; | ||
| return acc; | ||
| }, {}); | ||
| } | ||
|
|
||
| module.exports = createLookup; | ||
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.
Indentation is a bit off.