1. product
return arr.reduce((x, y) => x * y, 1);
2. string2int
return s.split("").map(x => +x).reduce((x, y) => x * 10 + y);
3. normalize
return arr.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase());
r = arr.map((x) => parseInt(x, 10));
Sign in to make a reply
Mason
1. product
return arr.reduce((x, y) => x * y, 1);
2. string2int
return s.split("").map(x => +x).reduce((x, y) => x * 10 + y);
3. normalize
return arr.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase());
r = arr.map((x) => parseInt(x, 10));