Detect whether a string has a letter 'b' 3 characters after 'a'
Using a regular expression is definitely the way to go — that's exactly what they are good at doing.  The following regex looks for 'a', followed by any number of spaces, followed by a non-space character, followed by any number of spaces, followed by a non-space character, followed by any number of spaces, followed by 'b'. 



function bThreeAfterA(str) {
    return /a *[^ ] *[^ ] *b/.test(str);
}

console.log('after badly', bThreeAfterA('after badly'));
console.log('Laura sobs', bThreeAfterA('Laura sobs'));




You should be aware, though, that you are using .some() suboptimally.  The .some(callback) method stops executing as soon as the callback returns a true value.  But you've already built trueOrFalse by analyzing the entire string, instead of taking advantage of that short-circuiting.  Therefore, if you use .some(), you shouldn't also use .map().



function bThreeAfterA(str) {
    // Array of characters without spaces
    var chars = str.split(' ').join('').split('');
    return chars.some(function(c, i, chars) {
        return c == 'a' &amp;&amp; chars[i + 3] == 'b';
    });
}

console.log('after badly', bThreeAfterA('after badly'));
console.log('Laura sobs', bThreeAfterA('Laura sobs'));