To use the select
function from underscore.js in JavaScript, follow these steps:
38 chars2 lines
index.tsx127 chars7 lines
select
function to filter the array based on a predicate. The predicate is a function that returns true or false for each element of the array. In this example, we will select all users who are over 21 years old:index.tsx160 chars7 lines
filter
method instead of select
, as they do the same thing:index.tsx160 chars7 lines
gistlibby LogSnag