Second for loop


Hello, my name is Dominik,
I'm in this exercises, i've written my code, but it keeps telling me this:
"Oops, try again. Make sure you're pushing letters to the hits array!"
Can somebody help? Thanks for your time!

/*jshint multistr:true */
var text = " My name is Dominik, why Dominik? You would ask, \
because my parents thought that 'Dominik' was a good name. ";
var myName = "Dominik";
var hits = [];
for (var i = 0; i < text.length; i++) {
    if (text[i] === myName[0]) {
        for (var j = i; j < i + myName.length; j++) {


HI this line


where you have myName[j] it should be text[j]


Thank you a lot! You are always behind my back! Can I help you in some way?


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.