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

homework number 15 #13

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

homework number 15 #13

wants to merge 2 commits into from

Conversation

maxeasy18
Copy link
Collaborator

Only 2 tasks.
Phone-book will be in other branch

let res = [];
function subFlatten(arr){
arr.forEach(function(value){
if(!Array.isArray(value)){
Copy link
Member

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

Copy link
Collaborator Author

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){
Copy link
Member

Choose a reason for hiding this comment

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

please use arrow function

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@maxeasy18
Copy link
Collaborator Author

Changes applied

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