Generated Random Text Output - Javascript Math

Javascript examples for Math:random

Description

Generated Random Text Output

Demo Code

ResultView the demo in separate window

<html lang="en">
   <head></head>
   <body translate="no"> 
      <script>
      var sentences =["Y","Z","A","B","C"];
var index = Math.floor(Math.random() * sentences.length);
console.log(sentences[index]);
    /*w w  w  .ja v a 2s.  c  o  m*/
      </script>  
   </body>
</html>

Related Tutorials