SHARE
TWEET

Untitled

a guest Oct 19th, 2019 91 in 6 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function modifyArray(nums) {
  2.     return nums.map(item => {
  3.         (item % 2 == 0) ? item * 2 : item * 3
  4.     });
  5. }
  6.  
  7. let nums = [1, 2, 3, 4, 5];
  8. console.log(modifyArray(nums));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top