Why do we need to input in the last else condition "hits.length"?


I just tried it changing the condiotion with (hits === 0) and it appears the same as using (hits.length === 0) when I push on the submit button.
Is there a difference or both options are ok?
This is the code:

/*jshint multistr:true */
var text = "You are my guest. You can visit my house but you must not touch anything. My name is Mihai and I love sport. blah blah blah Mihai is good with computers.";
var myName = "Mihai";
var hits = [];
for(i = 0; i < text.length; i++) {
    if(text[i] === "M") {
        for(j = i; j < (myName.length + i); j++) {
if(hits === 0) {
    console.log("Your name wasn't found!");
else {

And also, I don't understand what's this /*jshint multistr:true */ for?



With hits.length you determine, if you have any =elements= in the hits Array.

For an answer to your second question