Options
All
  • Public
  • Public/Protected
  • All
Menu

Module array/slice

Index

References

Functions

References

Renames and re-exports slice

Functions

  • slice(a: number, b: number, list: string): string
  • slice<T>(a: number, b: number, list: ArrayLike<T>): T[]
  • slice(a: number, b: number): { (list: string): string; <T>(list: ArrayLike<T>): T[] }
  • slice(a: number): { (b: number, list: string): string; <T>(b: number, list: ArrayLike<T>): T[]; (b: number): { (list: string): string; <T>(list: ArrayLike<T>): T[] } }
  • Returns the elements of the given list or string (or object with a slice method) from fromIndex (inclusive) to toIndex (exclusive).

    example
     slice(1, 3, ['a', 'b', 'c', 'd']);        //=> ['b', 'c']
    slice(1, Infinity, ['a', 'b', 'c', 'd']); //=> ['b', 'c', 'd']
    slice(0, -1, ['a', 'b', 'c', 'd']); //=> ['a', 'b', 'c']
    slice(-3, -1, ['a', 'b', 'c', 'd']); //=> ['b', 'c']

    Parameters

    • a: number
    • b: number
    • list: string

    Returns string

  • Returns the elements of the given list or string (or object with a slice method) from fromIndex (inclusive) to toIndex (exclusive).

    example
     slice(1, 3, ['a', 'b', 'c', 'd']);        //=> ['b', 'c']
    slice(1, Infinity, ['a', 'b', 'c', 'd']); //=> ['b', 'c', 'd']
    slice(0, -1, ['a', 'b', 'c', 'd']); //=> ['a', 'b', 'c']
    slice(-3, -1, ['a', 'b', 'c', 'd']); //=> ['b', 'c']

    Type parameters

    • T

    Parameters

    • a: number
    • b: number
    • list: ArrayLike<T>

    Returns T[]

  • Returns the elements of the given list or string (or object with a slice method) from fromIndex (inclusive) to toIndex (exclusive).

    example
     slice(1, 3, ['a', 'b', 'c', 'd']);        //=> ['b', 'c']
    slice(1, Infinity, ['a', 'b', 'c', 'd']); //=> ['b', 'c', 'd']
    slice(0, -1, ['a', 'b', 'c', 'd']); //=> ['a', 'b', 'c']
    slice(-3, -1, ['a', 'b', 'c', 'd']); //=> ['b', 'c']

    Parameters

    • a: number
    • b: number

    Returns { (list: string): string; <T>(list: ArrayLike<T>): T[] }

      • (list: string): string
      • <T>(list: ArrayLike<T>): T[]
      • Parameters

        • list: string

        Returns string

      • Type parameters

        • T

        Parameters

        • list: ArrayLike<T>

        Returns T[]

  • Returns the elements of the given list or string (or object with a slice method) from fromIndex (inclusive) to toIndex (exclusive).

    example
     slice(1, 3, ['a', 'b', 'c', 'd']);        //=> ['b', 'c']
    slice(1, Infinity, ['a', 'b', 'c', 'd']); //=> ['b', 'c', 'd']
    slice(0, -1, ['a', 'b', 'c', 'd']); //=> ['a', 'b', 'c']
    slice(-3, -1, ['a', 'b', 'c', 'd']); //=> ['b', 'c']

    Parameters

    • a: number

    Returns { (b: number, list: string): string; <T>(b: number, list: ArrayLike<T>): T[]; (b: number): { (list: string): string; <T>(list: ArrayLike<T>): T[] } }

      • (b: number, list: string): string
      • <T>(b: number, list: ArrayLike<T>): T[]
      • (b: number): { (list: string): string; <T>(list: ArrayLike<T>): T[] }
      • Parameters

        • b: number
        • list: string

        Returns string

      • Type parameters

        • T

        Parameters

        • b: number
        • list: ArrayLike<T>

        Returns T[]

      • Parameters

        • b: number

        Returns { (list: string): string; <T>(list: ArrayLike<T>): T[] }

          • (list: string): string
          • <T>(list: ArrayLike<T>): T[]
          • Parameters

            • list: string

            Returns string

          • Type parameters

            • T

            Parameters

            • list: ArrayLike<T>

            Returns T[]

Generated using TypeDoc