Skip to content

More Functions - #35

Open
kenjelly22 wants to merge 7 commits into
learn-co-curriculum:masterfrom
kenjelly22:more-functions
Open

More Functions#35
kenjelly22 wants to merge 7 commits into
learn-co-curriculum:masterfrom
kenjelly22:more-functions

Conversation

@kenjelly22

Copy link
Copy Markdown

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

@stephenmckeon stephenmckeon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice!

Comment thread index.js
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}!`;
}

Copy link
Copy Markdown

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 thread index.js
Comment on lines +10 to +13
switch (activity) {
case "work from home":
activity = "work from home";
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same idea here.

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

Copy link
Copy Markdown

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