Ad

const addArr

Code
Diff
  • const addArr = (arr) => arr.reduce((acc, i) => acc + i, 0) || null
    • const addArr = (arr) => {
    • let sum = 0;
    • for (let i = 0; i < arr.length; i++) {
    • sum += arr[i];
    • }
    • return sum || null;
    • };
    • const addArr = (arr) => arr.reduce((acc, i) => acc + i, 0) || null
Code
Diff
  • for(let i = 0; i < 10; i++) console.log("Matthew is gay");
    • var b = 5;
    • var a = 6;
    • do {
    • console.log("Matthew is gay");
    • a++;
    • } while(a<16);
    • for(let i = 0; i < 10; i++) console.log("Matthew is gay");