Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@annagabain
Copy link
Owner

No description provided.

Week3/homework/MY-step2-1-Hello_I_am_bar.js Outdated Show resolved Hide resolved
@annagabain annagabain changed the title managed ex 1 so far :(( almost there Aug 12, 2019
@annagabain annagabain changed the title almost there done Aug 14, 2019
function foo(func) {
// What to do here?
// Replace this comment and the next line with your code
return ('Hi, I am AaaaT, who are you?');
Copy link

Choose a reason for hiding this comment

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

Same problem again. This function should take a function and invoke/call it. Not return anything.

}
}
}
return flattenArr3;
Copy link

Choose a reason for hiding this comment

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

This works, but also take a look at .flat() later. May have made things even easier ;)


//x is 9 and does not change after the f1 function is executed but it does if I console.log(f1(x)), I do not know why. Maybe because x was defined outside of the f1 function scope

//y is returned after going through the f2 function where the value of y(that is an object containing x) is changed by adding 1 to x. 9+1=10
Copy link

Choose a reason for hiding this comment

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

I think you get it (?). Another example:

let a = 4
let b = a
a += 1
What's the value of b?

vs objects...

let a = { name: 'gabe' }
b = a
a.country = 'us'
what's the value of b?

Do you see the difference?

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.