Array<T>

Array is a generic type.

  • T[ ] : shorthand for Array<T>

  • readonly T[ ] : shorthand for ReadonlyArray<T>

interface Array<T> {

  length: number;
 
  // remove last element & returns it.
  pop(): T | undefined;
 
  // append new elements & return new length.
  push(...items: T[]): number;
}

Last updated