tubeshowcase●1,194,391 videos♡ My collection 0
← Learn to Code

Learn to Code04:01

Random number generator in JavaScript 🎲【4 minutes】

Bro Code ↗

From the creator

#Javascript #random #number #generator let x; let y; let z; document.getElementById("rollButton").onclick = function(){ x = Math.floor(Math.random() * 6) + 1; y = Math.floor(Math.random() * 6) + 1; z = Math.floor(Math.random() * 6) + 1; document.getElementById("xlabel").innerHTML = x; document.getElementById("ylabel").innerHTML = y; document.getElementById("zlabel").innerHTML = z; }

Published 2022-04-21 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code