We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Day 5: Arrow Functions
Day 5: Arrow Functions
Sort by
recency
|
440 Discussions
|
Please Login in order to post a comment
In JS
Managed to fit in one line:
function modifyArray(nums) { let newArr = nums.map(x => x % 2 === 0 ? x * 2 : x * 3); return newArr; }