I am completing a homework assignment where I will have to filter an array into a new array for a vehicle with the term of “ford” in it. The assignment wants the format to be in ES6 using the arrow function syntax so something like
const arr = [
{name: “Honda”, type: “Accord”},
{name: “ford”, type: “fusion”},
{name: “Toyota”, type: “Camry”}
]
const newArr = [...arr].filter(value => value === ‘ford’);
Console.log(newArr);
I know this is incorrect and wouldn’t actually get the name of the vehicle that has “ford” in it but I’m giving an example on how they would want it formatted.