Skip to content

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