Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript print random word from lsit

var word = ['Rock', 'Paper', 'Scissor'];
var words = word[Math.floor(Math.random()*word.length)];
alert('The computer chose:' + words);

// Be sure to add more to the string values if you wish to add more words.
Comment

PREVIOUS NEXT
Code Example
Javascript :: js onclick change styles 
Javascript :: regex match line that does not contain string 
Javascript :: remove property from object js 
Javascript :: How to check if array includes a value from another array in JavaScript 
Javascript :: pageyoffset jquery 
Javascript :: push characters to a string javascript 
Javascript :: select all elements javascript 
Javascript :: cdn react 
Javascript :: how to render a new page in node js through express 
Javascript :: js get current timezone offset 
Javascript :: is java and javascript the same 
Javascript :: Getting Binary gap in JS 
Javascript :: check if element has specific child javascript 
Javascript :: angular for loop 
Javascript :: js string to regex 
Javascript :: package.json set environment variables 
Javascript :: how to navigate programatically in class component react router v6 
Javascript :: jquery set form target 
Javascript :: how to use url parameters in react 
Javascript :: datatables get all rows 
Javascript :: javascript string contains function 
Javascript :: select2 find option by value 
Javascript :: js remove seconds from time 
Javascript :: nl2br javascript 
Javascript :: remove role discord.js 
Javascript :: javascript use variable regex 
Javascript :: search in string array javascript 
Javascript :: method to look for objects in arrays by id 
Javascript :: discord.js ban command 
Javascript :: submit a form on enter angular 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =