xython
July 26, 2018, 8:15pm
21
Try it!
/Post must be at least 20 characters and system messages not so annoying! /
Thank you so much! I was able to complete the level. I had to remove the lens from the if statement and remove the return true at the bottom of the code.
return true; // ∆ Remove this when the function is written.
braedon12:
function wordInString(string, word) {
var lenString = string.length;
var lenWord = word.length;
// Step through indexes (i) from 0 to (lenString - lenWord)
for ( var i = 0; i < (lenString - lenWord); i++) {
// For each of them step through indexes (j) of the word length
for (var j = 0; j < lenWord; j++) {
// If [i + j]th letter of the string is not equal [j]th letter of world, then break loop
if ([i + j] != [j]) {
break;
}
// if this is the last letter of the word (j == lenWord - 1), then return true.
if (j == lenWord - 1) {
return true;
}
// If loops are ended then the word is not inside the string. Return False.
}
}
return true; // ∆ Remove this when the function is written.
}
post the code pls
LKAFDs lskfs fsdfs df sdsd f