Assesment wanted for Functions 3 skill test

Hello everyone!

My solution works, but I would like to know if this is the right approach.

Here is the code: https://jsfiddle.net/christmed/ak9ucy6b/2/

Thanks!

Hello @christmed

you doing great well done but a little modification would make your code more flexible

  1. change this line
      randomIndex = random(0, 4);

to

      randomIndex = random(0, names.length);
  1. i know that array index start from 0 but to make the random method more generic you can do this
Math.floor(Math.random() * range);

to

Math.floor(Math.random() * range)+min;

so if the min was not 0 it would still work

hope that help and have a nice day :slight_smile:

1 Like