The without()
function, part of the Underscore utility library, is a useful tool to remove specified values from an array. Here's how you can use the 'without' function in JavaScript:
38 chars2 lines
without()
function, passing your array and the values you want to remove as arguments. For example:index.tsx134 chars5 lines
In this example, the without()
function is used to remove the numbers 3 and 6 from the original array.
Note that the without()
function creates a new array, rather than modifying the original array in place.
gistlibby LogSnag