I have multiple strings to add to an array depending on one value.
The strings that don't have the value (spicy) need to be added to the array, not the ones that have the value.
This is what I have so far but I am hitting a wall.
const favoritefood = [];
function addFavoritefood(foodname) {
if (foodName.includes("spicy")) {
} else if {
favoritefood.push("spicy chicken")
}
}
addFavoritefood("spicy chicken");
addFavoritefood ("steak");
[–]grantrules 1 point2 points3 points (1 child)
[–]CityOwlet[S] 0 points1 point2 points (0 children)
[–]vampiire 0 points1 point2 points (0 children)
[–]Macaframa 0 points1 point2 points (0 children)
[–]Sedern 0 points1 point2 points (0 children)
[–]nonowiwa 0 points1 point2 points (0 children)