Assessment wanted for Functions 3 test

Hello,

Looking for some feedback on my solution to task 3 on this skill test https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Test_your_skills:_Functions

I’m not sure that I understood the instructions…I was basically trying to narrow down the possible names that were randomly generated. My function now prints one of the first 2 or last 2 names in the array, but is this what the task was asking for? And if so are there better ways to go about it?https://codepen.io/bryrosh27/pen/yLOJrvb

Thanks!

Hello @bryrosh27

you doing great even i really did not got all your code

but what about this one check it

function chooseName() {

para.textContent=names[Math.floor(Math.random()*names.length)];
}
chooseName(); 

well done again and have a nice day

Thanks for the tip, that’s a lot more concise!

you very welcome :slight_smile: