Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

add task solution #2671

wants to merge 4 commits into from

Conversation

Wesses
Copy link

@Wesses Wesses commented Aug 2, 2023

No description provided.

// write code here
[].__proto__.join2 = function(separator = ',') {
let string = '';
const newSeparator = separator;
Copy link

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?

Comment on lines 17 to 18
string += String(this[i]);
string += newSeparator;
Copy link

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?

Comment on lines 13 to 16
if (this[i] === null || this[i] === undefined) {
string += newSeparator;
continue;
}
Copy link

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]

@Wesses Wesses requested a review from tiserett August 7, 2023 20:18
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