Just need help in identifying what I am doing wrong on this codewar challenge.
I realize this may be easy for some but please note I am just a beginner with Javascript.
If you want to get the first occurrence without iterating to the last item but without using an imperative code you may do as by using .find() checking inside if the rightmost bit of n is 1;
var arr = [2, 4, 0, 100, 4, 11, 2602, 36],
resodd = arr.find(n => n & 1),
reseven = arr.find(n => !(n & 1));
console.log(resodd, reseven);