
Variables and Data Types in JavaScript
Every program you will ever write starts with the same move: storing information so you can use it later. A user's name, a score, a shopping cart total, a…
Read tutorialCore programming concepts and building blocks of JavaScript for beginners.
Tutorials
Follow these lessons in order, or jump directly to the topic you need.

Every program you will ever write starts with the same move: storing information so you can use it later. A user's name, a score, a shopping cart total, a…
Read tutorial
You've learned how to store values in variables. Now it's time to make those values do something. JavaScript operators are the verbs of your code—they add,…
Read tutorial
A website is mostly text doing work: a signup form checking an email address, a search bar cleaning up what a user typed, a dashboard greeting someone by…
Read tutorial
A variable can hold one value—and that value can be a collection holding many related values. JavaScript arrays and objects are how you build those…
Read tutorial
Every program you write has to react to the world around it. A login form needs to say "Welcome back" to one person and "Invalid password" to another. A…
Read tutorial
Five console.log statements will print five numbers. Fifty will print fifty. Five hundred will print five hundred—if you have the patience to write them…
Read tutorial
You know how to build an array. Now comes the part where every beginner hits the same wall: you need to change the values, keep only some of them, or total…
Read tutorial
You already know how to declare a variable. You've probably written let score = 0 or const userName = "Alex" and moved on. But then you open an older…
Read tutorial
Now you're stuck on a question that feels bigger than the error itself: do you change the const to let, or do you rewrite the line that's failing? The…
Read tutorial
You can loop over an array three different ways, and they all look nearly identical when you write them. So which one should you use?
Read tutorial
You can write an if/else statement. You know where the braces go and what console.log does. But when the condition gets even slightly tricky, you hesitate.…
Read tutorial
You have text in a variable. You want to check it, cut it, clean it, or change it. But which method does which—and what does each one give you back?
Read tutorial