Options
All
  • Public
  • Public/Protected
  • All
Menu

Module array/take

Index

References

Functions

References

Renames and re-exports take

Functions

  • take(n: number, xs: string): string
  • take<T>(n: number, xs: ArrayLike<T>): T[]
  • take(n: number): { (xs: string): string; <T>(xs: ArrayLike<T>): T[] }
  • Returns the first n elements of the given array or string

    example
     take(1, ['foo', 'bar', 'baz']); //=> ['foo']
    take(2, ['foo', 'bar', 'baz']); //=> ['foo', 'bar']
    take(3, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']
    take(4, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']
    take(3, 'ramda'); //=> 'ram'

    Parameters

    • n: number
    • xs: string

    Returns string

  • Returns the first n elements of the given array or string

    example
     take(1, ['foo', 'bar', 'baz']); //=> ['foo']
    take(2, ['foo', 'bar', 'baz']); //=> ['foo', 'bar']
    take(3, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']
    take(4, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']
    take(3, 'ramda'); //=> 'ram'

    Type parameters

    • T

    Parameters

    • n: number
    • xs: ArrayLike<T>

    Returns T[]

  • Returns the first n elements of the given array or string

    example
     take(1, ['foo', 'bar', 'baz']); //=> ['foo']
    take(2, ['foo', 'bar', 'baz']); //=> ['foo', 'bar']
    take(3, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']
    take(4, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']
    take(3, 'ramda'); //=> 'ram'

    Parameters

    • n: number

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

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

        • xs: string

        Returns string

      • Type parameters

        • T

        Parameters

        • xs: ArrayLike<T>

        Returns T[]

Generated using TypeDoc