-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
add task solution #2671
base: master
Are you sure you want to change the base?
add task solution #2671
Conversation
src/arrayMethodJoin.js
Outdated
// write code here | ||
[].__proto__.join2 = function(separator = ',') { | ||
let string = ''; | ||
const newSeparator = separator; |
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.
why would you create this variable?
src/arrayMethodJoin.js
Outdated
string += String(this[i]); | ||
string += newSeparator; |
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.
can we use easier approach here?
src/arrayMethodJoin.js
Outdated
if (this[i] === null || this[i] === undefined) { | ||
string += newSeparator; | ||
continue; | ||
} |
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.
let's create variable for this[i]
No description provided.