using the Array.prototype.filter() method, filter through the presidents array and console.log only the presidents who were born in the 1900's. code example

Example 1: array filter

const words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];

const result = words.filter(word => word.length > 6);

console.log(result);
// expected output: Array ["exuberant", "destruction", "present"]

Example 2: js filter items by index

let newArray = arr.filter(callback(element[, index, [array]])[, thisArg])