repl.it
@Milfie/

KnownDarkorangePackages

Nodejs

No description

fork
loading
Files
  • index.js
index.js
1
2
3
4
5
6
7
8
9
10
function modifyArray(nums) {
  return nums.map(item => {
    return (item % 2 == 0 ? item * 2 : item * 3);
  });
}

let nums = [1, 2, 3, 4, 5];

console.log("[" + nums + "] => [" + modifyArray(nums) + "]");
node v10.16.0