Test case details

Preparation Code

var recipients = []; var start = performance.now(); for (i=1000000;i>0;i--){ var email = Math.random().toString(36).substring(12); var first_name = Math.random().toString(36).substring(7); var last_name = Math.random().toString(36).substring(9); var step = Math.floor(Math.random() * 10) recipients.push({ email: email, first_name: first_name, last_name: last_name, step: step, created_on: "123", next_thing: "123" }) } var search = "abc";
var duration = performance.now() - start; console.log(duration + " milliseconds")

Test cases

Test #1

recipients.filter(recipient => recipient.email && recipient.email.toLowerCase().indexOf(search) > -1 || recipient.first_name && recipient.first_name.toLowerCase().indexOf(search) > -1 || recipient.last_name && recipient.last_name.toLowerCase().indexOf(search) > -1 )

Test #2

recipients.filter(recipient => recipient.step == 2 )