Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
/* ============ Functions ==========
Broadly, Functions are predefined commands for
performing an action. For example:
- prompt('enter your answer')
- alert('response to the user')
- moveForward(4)
- turnRight()
- platform.create(100, 500)
Here are some examples of predefined Math functions:
    Math.min(10, 20)    //=> 10
    Math.max(4, 8)      //=> 8
    Math.random()       //=> A random decimal between 0.0 to 0.999...
    Math.floor(4.5)     //=> 4
    
To call/execute the function, type: functionName(argument)
NOTE: not all functions need argument(s)!
Instructions:
1) call each Math function with your own numbers and 
assign the function call to the result variable 
2) Try combining them by feeding the results of 
one function into another!
  
Challenge:
Using the functions above and the * operator, generate a random 
integer between 0 and 9
   ================================= */
var result = Math.min(10, 20);
console.log(result);
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
benspector3pro
0viewers