Array of names in a function? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Array of names in a function?

/** * @param {Array<string>} arrayOfPeople - an array of people's names * @returns {number} the length of the given array of names */ function numberOfPeople(arrayOfPeople) { return arrayOfPeople = ["Alex", "Beau", "Carlos", "Dustin"]; } console.log(numberOfPeople(arrayOfPeople.length)); //says arrayOfPeople is undefined?

13th Feb 2021, 11:50 PM
tristach605
tristach605 - avatar
0 Answers