-
Notifications
You must be signed in to change notification settings - Fork 0
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
homework number 15 #13
base: master
Are you sure you want to change the base?
Conversation
let res = []; | ||
function subFlatten(arr){ | ||
arr.forEach(function(value){ | ||
if(!Array.isArray(value)){ |
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.
are you using tabs in development? :)
that task is a perfect candidate for reduce instead of forEach
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.
What do you mean saying "tabs"?
And no, I can't do this task with reduce.
const flatten = arr => { | ||
let res = []; | ||
function subFlatten(arr){ | ||
arr.forEach(function(value){ |
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.
please use arrow function
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.
Done
Changes applied |
Only 2 tasks.
Phone-book will be in other branch