1
Modify the function to return true if the array contains a 0, and returns false otherwise.
Paultheriault (0)

function doesArrayContainZero(numbers) {

}
Can anyone help me solve this please.

You are viewing a single comment. View All
1
vedprad1 (439)
function doesArrayContainZero(numbers) {
  for (var i = 0; i < numbers.length; i++) {
    if (numbers[i] == 0) {
      return true;
    }
  }
  return false;
}

If this answers your question, please check the checkmark on the left side of this message. Thanks and Good Luck!

1
ash15khng (209)

@vedprad1 You shouldn't be doing his work for him...