Skip to content
This repository has been archived by the owner on Oct 26, 2020. It is now read-only.

Week4 homework #929

Open
wants to merge 15 commits into
base: scotland-class4
Choose a base branch
from
Open

Conversation

mara-ber
Copy link

@mara-ber mara-ber commented Jun 5, 2020

Your Details

Your Name: Marina
Your City: Glasgow
Your Slack Name:

Homework Details

Module:
Week:

@mara-ber mara-ber marked this pull request as draft June 5, 2020 18:33
@mara-ber mara-ber marked this pull request as ready for review June 5, 2020 18:36
@alastair87 alastair87 self-assigned this Jun 14, 2020
//---------------------------------------

// 3. Declare a function "isSafeForNutAllergies" that accepts "food" as a parameter
// and returns false if it found the word "sesame" in the ingredients, or true otherwise

function isSafeForNutAllergies(food) {
return !food.ingredients.includes("sesame seeds");
//write code here

Choose a reason for hiding this comment

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

You need to check for the word "sesame" in the ingredients so it's a bit more than checking if the food.ingredients array includes sesame seeds. You need to use an array function that will iterate (loop) through the ingredients and then check whether each string contains that function. I would suggest that you will need to use an array function, a function of your own that you use on each element and then a function of string to check what each one includes. From this you should be able to work out whether it's true or not that there is at least one ingredient with the word sesame in it.

console.log(greet("FINNish"));
console.log(greet("russian"));
console.log(greet(6));
return languages[language];
}

Choose a reason for hiding this comment

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

This return outside the function can be removed as it doesn't do anything.

Copy link
Author

Choose a reason for hiding this comment

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

that's not what I have in my file. there are no lines 32,33 and 52,53. Why are they shown here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants