6/7 Log It question regarding hits.length === 0


#1

if(hits.length === 0){
console.log("Your name wasn't found!");
}

Does the 0 here refer to that there is nothing in the hit = [] or are we talking about that there could possibly be one letter (because arrays have a zero based index)? and why?


#2

@goldiefish,
From
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
you can learn,
that if you create an Array
javascript will also create a so-called length property
which represents the count-of-Elements in the form of a number Value