💻 Coding Basics

Click an example to load it into the editor — then run it, tweak it, break it, fix it.

▶ JavaScript Sandbox
Output will appear here…

🧠 Quick Check

What is this?

JavaScript is one of the world's most-used programming languages — it runs in every web browser. The concepts here (variables, loops, functions, arrays) apply to almost every language: Python, Java, C++, Swift.

Why does it matter?

Coding teaches structured problem-solving. Even if you never become a developer, understanding how programs work helps you automate tasks, work with data, and reason about technology.

Key terms
Variable — named container storing a value Function — reusable named block of code Loop — repeat code a set number of times or until a condition changes Array — ordered list of values accessed by index Boolean — true or false; drives all logic Recursion — function that calls itself; needs a base case to stop Big-O — notation for algorithm efficiency (O(n), O(log n), O(n²))
🎯 Try this challenge

Write a function called isEven(n) that returns true if n is even and false if it's odd. Then call it in a loop from 1 to 10 and print each result. How many lines does it take?

Continue Learning
Logic Gates