Skip to content

More Functions #35

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

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

Conversation

kenjelly22
Copy link

Created 3 different types of functions including: function, function expression and Function-Level Scope.

Copy link

@stephenmckeon stephenmckeon left a comment

Choose a reason for hiding this comment

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

Nice!

Comment on lines +1 to +7
function saturdayFun(activity = "roller-skate") {
switch (activity) {
case "bathe my dog":
activity = "bathe my dog";
}
return `This Saturday, I want to ${activity}!`;
}

Choose a reason for hiding this comment

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

I think this would also pass the test:

Suggested change
function saturdayFun(activity = "roller-skate") {
switch (activity) {
case "bathe my dog":
activity = "bathe my dog";
}
return `This Saturday, I want to ${activity}!`;
}
function saturdayFun(activity = "roller-skate") {
return `This Saturday, I want to ${activity}!`;
}

Comment on lines +10 to +13
switch (activity) {
case "work from home":
activity = "work from home";
}

Choose a reason for hiding this comment

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

Same idea here.

Comment on lines +18 to +23
function wrapAdjective(string = "*") {
const innerFunction = function (adjective = "special") {
return `You are ${string}${adjective}${string}!`;
};
return innerFunction;
}

Choose a reason for hiding this comment

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

Suggested change
function wrapAdjective(string = "*") {
const innerFunction = function (adjective = "special") {
return `You are ${string}${adjective}${string}!`;
};
return innerFunction;
}
function wrapAdjective(string = "*") {
return function (adjective = "special") {
return `You are ${string}${adjective}${string}!`;
};
}

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