Here is list of interesting functions available in underscorejs

 

  • reject: This function returns the values in list without the elements that matches the condition.

 

  • contains: This function returns true if the value is present in the list.

 

  • max: This function returns the maximum value in list.

 

  • shuffle: This functions helps us to shuffled copy of the list,

 

  • toArray: This function creates a real Array from the list.

 

  • first: This function returns the first element of an array.

 

  • last: This function returns the last element of an array

 

  • pairs: This function convert an object into a list of [key, value] pairs.

 

  • clone: This function create a shallow-copied clone.

 

  • matcher: This function helps in matching the key/value properties present in attrs.

Leave a Reply