repl.it
@Milfie/

WorthwhileRealServerapplication

Nodejs

No description

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

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

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