🟨 JavaScript Code Runner
Write and execute JavaScript code directly in your browser. Perfect for learning and testing code snippets.
Code Editor
ES2023+Input
Output
Click "Run Code" to see the output here
📝 Example Code Snippets
Hello World
Basic console.log statement
console.log('Hello, World!');
Variables & Math
Working with variables and calculations
const x = 10; const y = 20; console.log(x + y);
Arrays & Loops
Working with arrays and for loops
for (let i = 0; i < 5; i++) console.log(i);
Functions
Creating and using functions
const greet = (name) => `Hello, ${name}!`;
Objects
Working with objects
const student = { name: 'Alice', age: 20 };
Classes
ES6 class syntax and methods
class Person { constructor(name) { this.name = name; } }
💡 Tips for using the JavaScript Runner
- • All modern JavaScript features (ES2023+) are supported
- • Use console.log() to see output in the console
- • Async/await and Promises work perfectly
- • Code runs in a sandboxed environment for security
- • DOM APIs are available for browser-specific features