@keestalkstech/

CloudyPossibleSquares

Nodejs

No description

fork
loading
Files
  • index.js
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

const arr = [1, 2, 3];

/*const result = arr.map(function(nr){
  return nr * 2;
});*/

const result = arr.map(nr => {
  if(nr % 2 == 0)
  
    return nr * 4;

  return nr * 2;
});

console.log(arr);
console.log(result);

node v10.16.0