Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

closestNumber

  • closestNumber(array: number[], num: number): number
  • Returns the closest number out of an array.

    example
    
    // Returns 10
    getClosestNumber([0, 10, 20], 12);
    

    Parameters

    • array: number[]

      The array to search in.

    • num: number

      The number to search for the closest to.

    Returns number

intersperse

  • intersperse(array: any[], separator: any): any[]
  • Return an array with the separator interspersed between each element of the input array.

    example
    
    intersperse(["a", "b", "c"], "x"); // => ["a", "x", "b", "x", "c"]
    

    Parameters

    • array: any[]

      Array to intersperse.

    • separator: any

      Value to insert.

    Returns any[]

nodeListToArray

  • nodeListToArray(nodeList: NodeList): any[]
  • Converts a NodeList to an Array.

    example
    
    // => [div, div, …]
    toArray(document.querySelectorAll('div'));
    

    Parameters

    • nodeList: NodeList

      A NodeList.

    Returns any[]

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc