⚡ JavaScript Playground
Home
HTML
CSS
JavaScript Code
Run
Reset
console.log()
alert()
let x =
function
if/else
for loop
// 🚀 Welcome to the JavaScript Playground! // Type your code below and click "Run" to see what happens! // 📝 LESSON 1: Printing Messages // console.log() prints messages to the console console.log("Hello, world!"); console.log("I am learning JavaScript!"); // 📝 LESSON 2: Variables // Variables store information let myName = "Alex"; let myAge = 10; console.log("My name is " + myName); console.log("I am " + myAge + " years old"); // 📝 LESSON 3: Math // JavaScript can do math! let result = 5 + 3; console.log("5 + 3 = " + result); let bigNumber = 10 * 10; console.log("10 × 10 = " + bigNumber); // 📝 LESSON 4: Functions // Functions are reusable code blocks function sayHello(name) { console.log("Hello, " + name + "! 👋"); } sayHello("Friend"); sayHello("Tech Explorer"); // 🎮 TRY IT: Change the values above and run again! // Can you make it say your name and age?
Console Output
Clear
✨ Click "Run" to execute your JavaScript code!
💡 JavaScript Tips for Beginners
Here are some helpful tips:
console.log()
- Print messages
let x = 5;
- Create a variable
function
- Make reusable code
if/else
- Make decisions
for loop
- Repeat things
Use the snippet buttons above to quickly add code! ⚡
Got it! ✓
💡