Answers for "increment elements in array typescript"

0

increment elements in array typescript

let numbers: number[] = [1, 2, 3, 4, 5];

function addNumbers(i: number): number {
  let sum: number = (numbers[i] += 1);

  return sum;
}

let add: number = addNumbers(2);

console.log(add);
Posted by: Guest on November-23-2020

Code answers related to "increment elements in array typescript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language