Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #increment #elements #array #typescript
ADD COMMENT
Topic
Name
8+8 =