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

Develop #1

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

Develop #1

wants to merge 6 commits into from

Conversation

amanregu
Copy link
Owner

No description provided.

@amanregu amanregu requested a review from nnnkit June 14, 2019 07:35
Copy link
Collaborator

@nnnkit nnnkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the mentioned changes and put a pull request again.

storyOfMyLife.addWords('My code broke.'); // 'My code broke.'
storyOfMyLife.addWords('I ate some ice cream.'); //'My code broke. I ate some ice cream.'
storyOfMyLife.erase(); // ''

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not complete yet.


// Your code here.
// → [1, 2, 3, 4, 5, 6]

// Challenge 2. Your own loop
// Your code here.
function loop(n,condition,update,body) {
for(let n = n; condition; update)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cant have a function reference as the test condition in for loop because test condition only understand boolean. This will go in infinite loop.

}, {});
return result;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to save the result in result variable. You can directly return like below

function multiMap(arrVals, arrCallbacks) {
	return arrVals.reduce((accumulator, currentValue) => {
		accumulator[currentValue] = arrCallbacks.map(item => item(currentValue));
		return accumulator;
	}, {});
}

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