Given the below array, create a function which loops through each name, comparing the length of each to determine the longest name, save that name to the variable longest_name. Return longest_name to the another variable called answer and log the answer variable to the screen.
let array = [ "John", "Lee", "Smitty", "Cyren", "Linda", "Bart", "Jason", "Wilson", "Travis", "Newt"];
would it be something like this
let array = [ "John", "Lee", "Smitty", "Cyren", "Linda", "Bart", "Jason", "Wilson", "Travis", "Newt"];
let result = array.filter(val =>includes(val));
console.log(result);