Function toArray

  • Converts value to an array.

    Parameters

    • value: number

      The value to convert.

    Returns []

    Returns the converted array.

    5.6.0

    toArray({ 'a': 1, 'b': 2 })
    // => [1, 2]

    toArray('abc')
    // => ['a', 'b', 'c']

    toArray(1)
    // => []

    toArray(null)
    // => []
  • Converts value to an array.

    Parameters

    • value: ""

      The value to convert.

    Returns []

    Returns the converted array.

    5.6.0

    toArray({ 'a': 1, 'b': 2 })
    // => [1, 2]

    toArray('abc')
    // => ['a', 'b', 'c']

    toArray(1)
    // => []

    toArray(null)
    // => []
  • Converts value to an array.

    Parameters

    • value: null

      The value to convert.

    Returns []

    Returns the converted array.

    5.6.0

    toArray({ 'a': 1, 'b': 2 })
    // => [1, 2]

    toArray('abc')
    // => ['a', 'b', 'c']

    toArray(1)
    // => []

    toArray(null)
    // => []
  • Converts value to an array.

    Parameters

    • value: string

      The value to convert.

    Returns string[]

    Returns the converted array.

    5.6.0

    toArray({ 'a': 1, 'b': 2 })
    // => [1, 2]

    toArray('abc')
    // => ['a', 'b', 'c']

    toArray(1)
    // => []

    toArray(null)
    // => []
  • Converts value to an array.

    Type Parameters

    • T extends Map<any, any>

    Parameters

    • value: T

      The value to convert.

    Returns ReturnType<T["entries"]>

    Returns the converted array.

    5.6.0

    toArray({ 'a': 1, 'b': 2 })
    // => [1, 2]

    toArray('abc')
    // => ['a', 'b', 'c']

    toArray(1)
    // => []

    toArray(null)
    // => []
  • Converts value to an array.

    Type Parameters

    • T extends Set<any>

    Parameters

    • value: T

      The value to convert.

    Returns ReturnType<T["values"]>

    Returns the converted array.

    5.6.0

    toArray({ 'a': 1, 'b': 2 })
    // => [1, 2]

    toArray('abc')
    // => ['a', 'b', 'c']

    toArray(1)
    // => []

    toArray(null)
    // => []
  • Converts value to an array.

    Type Parameters

    • T extends object

    Parameters

    • value: T

      The value to convert.

    Returns Values<T>

    Returns the converted array.

    5.6.0

    toArray({ 'a': 1, 'b': 2 })
    // => [1, 2]

    toArray('abc')
    // => ['a', 'b', 'c']

    toArray(1)
    // => []

    toArray(null)
    // => []