Answers for "convert an array to other array"

0

convert an array to other array

["Nano","Volvo","BMW","Nano","VW","Nano"].reduce(function(a, e, i) {
    if (e === 'Nano')
        a.push(i);
    return a;
}, []);   // [0, 3, 5]
Posted by: Guest on September-10-2021

Code answers related to "convert an array to other array"

Browse Popular Code Answers by Language