I encountered a problem about an array list. I wanted to return a random name in the array list, but I encountered a problem when implementing it.
``function randomName(names) { names = ["john", "Ben", "Jenny", "Michael", "Chloe"]; Math.random(names.length); console.log(names); return names + "is going to buy lunch today!"; } randomName();
I want the output to be:
Michael (or any name in the array) is going to buy lunch today!
Can you guide me on how to achieve this?