I'm trying to pluralize words based on a count but my code is not working

Viewed 18

I am trying to pluralize a noun based on a count and I don't understand what's wrong.

// DO NOT CHANGE THE FOLLOWING INPUTS.
const noun = prompt("Enter a noun");
const count = prompt("Enter a number");

console.log(noun);
console.log(count);

// Returns the number and pluralized form, like "5 cats" or "1 dog", given
// a noun and count. Assume there are no irregular plural nouns.

if ((count > 1 ) || (count = 0)) {

  result = count + " " + noun + "s";
}else{

  result = count + " " + noun;
}
// DO NOT CHANGE THIS.
console.log(result);

This is a screenshot of the compiler .

1 Answers

You're using = (assignment) instead of == (comparison)

if ((count > 1 ) || (count == 0)) {
Related