You are viewing a single comment's thread. Return to all comments →
const modifyArray = (nums) => { return nums.reduce((acc, curr)=> { curr % 2 === 0 ? acc.push(curr * 2) : acc.push(curr * 3); return acc; }, [])
}
Seems like cookies are disabled on this browser, please enable them to open this website
Day 5: Arrow Functions
You are viewing a single comment's thread. Return to all comments →
const modifyArray = (nums) => { return nums.reduce((acc, curr)=> { curr % 2 === 0 ? acc.push(curr * 2) : acc.push(curr * 3); return acc; }, [])
}