Skip to content

Conversation

@lillapulay
Copy link

No description provided.

src/index.js Outdated
Comment on lines 46 to 49
let doubledArray = [];
for(i = 0; i < x.length; i++) {
doubledArray.push(x[i] * 2);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use higher order function instead, check out the map method of array in javascript

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the feedback, I updated the function!

Copy link

@UmerSharif UmerSharif left a comment

Choose a reason for hiding this comment

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

🥇

Comment on lines +12 to +18
exports.oddOrEven = function oddOrEven(x) {
if(x % 2 == 0) {
return ('even')
} else {
return ('odd')
}
};

Choose a reason for hiding this comment

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

nice work.

Comment on lines +59 to +63
// 1. ADD
const add = (x, y) => x + y;

// 2. MULTIPLY
const multiply = (x, y) => x * y;

Choose a reason for hiding this comment

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

may no need for spaces

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.

3 participants