-
Notifications
You must be signed in to change notification settings - Fork 12
task 3 #3
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
base: master
Are you sure you want to change the base?
task 3 #3
Conversation
IVAN_MARAKHOVSKII/countDown.js
Outdated
| @@ -0,0 +1,9 @@ | |||
| function countDown(n) { | |||
| for (let i = n; i >= 0; i--) { | |||
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.
Pretty much fine, but do you know another solution to the task without let?
IVAN_MARAKHOVSKII/stringExpansion.js
Outdated
| @@ -0,0 +1,30 @@ | |||
| function stringExpansion(str) { | |||
| if (str == "") { | |||
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.
Avoid using non strict comparisons
| ans[index] = item.split("").join(spl); | ||
| }); | ||
| return ans.join(spl); | ||
| } |
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.
Just a note
According to the description - your words should be separated by empty space, not separator you pass in
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.
What does empty space mean?
from description : "... and then divide each word into characters(Use separator empty string);"
|
Good work! |
IVAN_MARAKHOVSKII/convert.js
Outdated
| for (let i = 0; i < keys.length; i++) { | ||
| result.push([keys[i],hash[keys[i]]]); | ||
| } | ||
| return result; |
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.
You could also use Object.entries
| for (let i = 1 ; i < arguments.length ; i++){ | ||
| if (arguments[i] < min ) min = arguments[i] | ||
| } | ||
| return min |
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.
There are methods like .largest and .smallest that could be used fir simplicity
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.
it's undefined when i'm trying to get arguments.smallest() or arguments.smallest
IVAN_MARAKHOVSKII/transform.js
Outdated
| @@ -0,0 +1,14 @@ | |||
| function transform(arr) { | |||
| for (let i = 0; i < arr.length; i++) { | |||
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.
Just a note, you could use map to transform array
No description provided.