I am interested to discover how I can pass an if
clause to the map function. For example, how I can check if the element is 0 then add 2
to the element and then do the rest of calculation
var array1 = [1, 4, 0, 16, 0, 8];
const map1 = array1.map(x => x * 2);
console.log(map1);