Remove Falsey Values from an Array
Use without
as a means to remove falsey values from your arrays. The first argument to the without
method takes in an array which will represent the elements which are to be removed when found in the second argument array. You can include any values in the first argument array which you deem to be a "falsey" value.
R.without([false, null, ''], [false, null, '', 1, 2, null, 3, 4, false, 5]);
// Outputs
// [1, 2, 3, 4, 5]