Ad
Fundamentals
Arrays
Data Types
Code
Diff
  • function findOnly(arr) {
      let result;
      arr.forEach((i) => {
        result = i ^ result;
      });
      return result;
    }
    • function findOnly(arr) {
    • let result = 0;
    • let result;
    • arr.forEach((i) => {
    • result = i ^ result;
    • });
    • return result;
    • }
Fundamentals
Arrays
Data Types
Code
Diff
  • function getSum(array) {
      return array.reduce((total, num) => total += num);
    }
    • function getSum(array) {
    • //your code
    • return array.reduce((total, num) => total += num);
    • }