Careful: your second 'for' loop should stop when it reaches its current point in the string + myName.length


#1
var text = 'Beatae est magnam rerum nulla. Et hic qui et voluptates eaque qui. At voluptas eligendi qui ea unde. Dolore dolorem Vitaly veritatis a est laudantium facilis. Impedit quia maiores ipsam ratione eos rerum Vitaly facere. Porro praesentium ratione quia blanditiis quia voluptatem omnis et.';
var myName = 'Vitaly';
var hits = [];

for (var i = 0; i < text.length; i++) {
    if(text[i] === 'V') {
        var i2 = 0;
        for(var j = i; i2 < myName.length; i2++) {
            hits.push(text[j++]);
        }
    }
}

This code works correctly at Firefox. It looks like problem with your linter...


#2

Hello,

Please what help or question do you need?

Thank you. :slight_smile:


#3

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