The use case i'm thinking about would be a project with a couple different branches. I would want to randomly send the learner down 2 of the 4 branches. The idea would be each time they take the course, the branches they are presented with could be different.
You would indeed need JS to populate a variable with a random number. You can then set up the navigation to a branch based ton that number. Do not forget to turn on Branch aware if you have custom questions.
I used random numbers in different blog posts. Here is one of them: