Hackerrank challenge - Apple and Orange
Just a few if statements will do.
Your answer to the problem is rather strange.
To find out if an apple or orange is between s and t is just a simple if statement.
if(apple[index] + appleTreePos &gt;= s &amp;&amp; apple[index] + appleTreePos &lt;= t){ 
    // Apple is on the house.

// Same for the orange.

So you only need to loop over the apples and oranges once. Best is to have a single loop that does both the apples and oranges at the same time, then a second loop to do the remaining (if any) fruit.
There is no need to create any arrays. Your solutions is exponentially lots more work than is needed. For speed aim to reduce the number of times your code loops. Note that Array.map is the same as doing a for loop over each item, but much slower in this case.
NOTE I struck out exponentially and added &quot;lots&quot; as some have complained, I used it in the common vernacular (increasing rate of change) and not as in CS time complexity. 
Your code loops over the length of the house, then the number of apples and oranges, and then you loop the length of the house times the number of apples plus oranges.
If the house is 5 units wide and there are 5 of each fruit you iterate over them a total of (house pos to array) 5 + (map each fruit array) 5 + 5, (counting) 5 * (5 + 5) for a total of 65 iterations. This is 60 times too many.
Example
I have not run this code so there could be a few typos, but the general structure is as described above.
This is faster than your solution, If it is fast enough to pass the test I do not know.
function countApplesAndOranges(houseLeft, houseRight, appleTreePos, orangeTreePos, apples, oranges) {
    var appleCount = 0;
    var orangeCount = 0;
    var i = 0;

    // find smallest group
    const len = Math.min(apples.length, oranges.length);

    // do apples and oranges
    while (i &lt; len) {
        let pos = apples[i] + appleTreePos;
        appleCount += pos &gt;= houseLeft &amp;&amp; pos &lt;= houseRight ? 1 : 0;
        pos = oranges[i++] + orangeTreePos;
        orangeCount += pos &gt;= houseLeft &amp;&amp; pos &lt;= houseRight ? 1 : 0;
    }

    // if same number of fallen then return result
    if (apples.length === oranges.length) {
        console.log(`${appleCount}${'\n'}${orangeCount}`);
        return;
    }

    // if more apples have fallen the do remaining apples 
    if (apples.length &gt; len) {
        while (i &lt; apples.length) {
            const pos = apples[i++] + appleTreePos;
            appleCount += pos &gt;= houseLeft &amp;&amp; pos &lt;= houseRight ? 1 : 0;
        }
        // all done return result
        console.log(`${appleCount}${'\n'}${orangeCount}`);
        return;
    }    

    // must be more oranges so do the rest of them and return result
    while (i &lt; oranges.length) {
        const pos = oranges[i++] + orangeTreePos;
        orangeCount += pos &gt;= houseLeft &amp;&amp; pos &lt;= houseRight ? 1 : 0;
    }
    console.log(`${appleCount}${'\n'}${orangeCount}`);
 }