Skip to content

Conversation

@notnotzero
Copy link

No description provided.

@@ -0,0 +1,9 @@
function countDown(n) {
for (let i = n; i >= 0; i--) {
Copy link

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?

@@ -0,0 +1,30 @@
function stringExpansion(str) {
if (str == "") {
Copy link

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);
}
Copy link

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

Copy link
Author

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);"

@Adoree
Copy link

Adoree commented Aug 22, 2019

Good work!
One note tho, you do use a lot of for loops for arrays where you could use .forEach

for (let i = 0; i < keys.length; i++) {
result.push([keys[i],hash[keys[i]]]);
}
return result;
Copy link

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
Copy link

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

Copy link
Author

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

@@ -0,0 +1,14 @@
function transform(arr) {
for (let i = 0; i < arr.length; i++) {
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants