Collect.js | when() Function
The when() function is used to callback if the first argument in the given proves to be true. In JavaScript, the array is first converted to a collection and then the function is applied to the collection.Syntax:Â data.when(conditional ,rule) Parameters:Â This function accept two parameters as mentio