Options
All
  • Public
  • Public/Protected
  • All
Menu

Module std

module

std Copyright (c) Jin Yang. All Rights Reserved.

Index

Functions

Functions

erase

  • erase(a: any[], first: number, last: number): void
  • Parameters

    • a: any[]
    • first: number
    • last: number

    Returns void

insert

  • insert(array: any[], index: number, value: any): void
  • Insert a value into an array at a specific index.

    Example

    let data = [0, 1, 2];
    std.insert(data, 0, -1);  // [-1, 0, 1, 2]
    std.insert(data, 2, 12);  // [-1, 0, 12, 1, 2]
    std.insert(data, -1, 7);  // [-1, 0, 12, 1, 7, 2]
    std.insert(data, 6, 19);  // [-1, 0, 12, 1, 7, 2, 19]

    Parameters

    • array: any[]
    • index: number
    • value: any

    Returns void