JSFiddle - React, Tailwind, and code Playground

by Researcher

JavaScript

// Use $.grep to filter the array of objects down to only those which have a lastName property equal to "Doe." Save this modified array to the same folks variable.

var folks = [
   { firstName: "Joe", lastName: "Black" },
   { firstName: "John", lastName: "Doe" },
   { firstName: "Karen", lastName: "Doe" },
   { firstName: "Billy", lastName: "Jones" }
];
var folks = jQuery.grep(folks, function(n, i){
  return (n.lastName == "Doe" );
});

console.log(folks);