Loop
Functions
This example calls a function which performs a calculation, and returns the result:
Pick a scheme, any scheme!
width: 100px;
height: 100px;
background: green;
width: 100px;
height: 100px;
background: green;
transform: rotate(45deg);
width: 100px;
height: 100px;
background: green;
border-radius: 50%;
Arithmetic!
So, 100 + 50 =
22 * 37 =
127 - 93 =
My code
html
body
45 / 5 =
p id="demo3"
script
var x = 45 / 5;
document.getElementById("demo3").innerHTML = x;
/script
/html
/body
Prime Time Assignment
The Number.isInteger() function returns true if the value is an integer.
Click the button to check whether the values are integers.
Hi
p style="text-align: center" img src="img/cat.png" style="position: relative" script var cat = document.querySelector("img"); var angle = 0, lastTime = null; function animate(time) { if (lastTime != null) angle += (time - lastTime) * 0.001; lastTime = time; cat.style.top = (Math.sin(angle) * 20) + "px"; cat.style.left = (Math.cos(angle) * 200) + "px"; requestAnimationFrame(animate); } requestAnimationFrame(animate); /script