Posts by daniloxxv • 109 points
3 posts
-
0
votes3
answers209
viewsA: Undefined return when calling function
I would have to take a look at the rest of the code, but the result that’s giving my impression is that the variable result does not exist in the context in which it is invoked. You are exporting…
-
0
votes2
answers164
viewsA: Node.js server error (ejs)
The problem is using the break within the forEach. If you want to stop the loop without iterating over all elements of the array, the ideal would be to simply use a for. In this case it would be…
-
0
votes2
answers65
viewsA: Function that prints indexes of an array incrementally
Javascript: function skipIndex(arr){ let newArr = [] for (let i = 0, jump = 2; i < arr.length; i+=jump, jump++){ newArr.push(arr[i]) } return newArr }…