I am learning functions and doing the exercise ‘Test your skills: functions’. Can anyone help me check my answer below if it is correct ?
const names = [‘Chris’, ‘Li Kang’, ‘Anne’, ‘Francesca’, ‘Mustafa’, ‘Tina’, ‘Bert’, ‘Jada’];
const para = document.createElement(‘p’);
// Add your code here
function chooseName() {
para.innerHTML = names[Math.floor(Math.Random() * names.length)];
}
// Don’t edit the code below here!
section.innerHTML = ’ ';
section.appendChild(para);