Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Coin toss with JavaScript and HTML

var prob1 = Math.floor(Math.random() * 2) +1;

var prob2 = Math.floor(Math.random() * 2) +1;

if( prob1 === prob2){
   document.write('You Got TAIL');
 }else{
   document.write('You Got HEAD');
Comment

PREVIOUS NEXT
Code Example
Javascript :: arrow function no need for parentheses with only one parameter 
Javascript :: what to say to your ex 
Javascript :: close responsive menu after click 
Javascript :: not getting jsp option in sts 
Javascript :: aws amplify graphql null result 
Javascript :: how does we know which field is selected by user in nestjs query 
Javascript :: javascript loop Tool 
Javascript :: client.guilds foreach 
Javascript :: vscode autosuggest background 
Javascript :: custom hook for unique items in react 
Javascript :: laravel tabel json nullable 
Javascript :: no unused vars blank underscore javacript 
Javascript :: how to pop more then one element js 
Javascript :: routing in react jps 
Javascript :: powershell json check if property exists 
Javascript :: no unuseds varsnreactjs 
Javascript :: how to make a box in p5js 
Javascript :: alert message in js 
Javascript :: jquery to vanilla javascript 
Javascript :: react-hook-form input 
Javascript :: salesforce lightning call javascript every x seconds 
Javascript :: html css and javascript for web developers 
Javascript :: button color change loop in react 
Javascript :: Using anonymous functions as arguments of other functions 
Javascript :: nested while loop in javascript 
Javascript :: image uploading payload 
Javascript :: how to reload page with router next js 
Javascript :: stop React Ant Design Upload component from posting files automatically 
Javascript :: Dynamically Generated Table 
Javascript :: Pausing setInterval when page/ browser is out of focus 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =