JavaScript Basics

Learning Path ⋅ Skills: Running Code With Node, Variables, Text, Comparisons, Conditionals, Functions, Loops, Arrays, Objects, Debugging

A developer holds up a toy robot beside a machine that turns blocks into programs through LOG, IF, FUNCTION, LOOP, and ARRAY stations.

You don’t need any programming experience to start this learning path. From the first course, you’ll write JavaScript in VS Code on your own computer and run it with Node in the terminal. Along the way, exercises on this site check your code and give you instant feedback.

You’ll start by showing output with console.log() and fixing your first errors. Then you’ll name values, calculate with numbers, build messages from text, compare and convert values, and teach your programs to make decisions with if, else if, and else. Next, you’ll write your own functions, repeat work with loops, and ask questions in the terminal. Finally, you’ll keep lists of values in arrays and describe things with named fields in objects.

Each course ends with a small project, from a movie-night snack calculator to a secret-code guessing game you play in the terminal, followed by a recap of what you’ve learned. By the end, you’ll build a small program on your own computer that you understand and can explain.

JavaScript Basics

Learning Path ⋅ 9 Resources

Is this path right for you? Mentor AI knows what’s in it and can help you decide where to begin.

Write and Run Your First Programs

Set up VS Code and Node on your computer, then write, run, and change your first JavaScript programs. You’ll show output in the terminal, read error reports, and fix mistakes one step at a time.

Title image for Your First Programs (A smiling beginner types at a keyboard beside a retro machine whose SCRIPT.JS editor and NODE terminal print Hello!, with a red RUN button, a SNACKS receipt and popcorn.)

Course

Your First Programs

Write and run your first JavaScript programs with VS Code and Node, show output with console.log(), and fix your first errors.

Work With Numbers and Text

Give values names, calculate with them, and turn the results into messages people can read. Then you’ll compare values to get yes-or-no answers, convert numeric text into numbers, and check each result against what you expected.

Title image for Values, Names, and Text (A developer holds up a printed message beside a green PASS light at a bill machine where CONST and LET number tiles and pizza boxes feed a TOTAL display.)

Course

Values, Names, and Text

Give values names with let and const, calculate with numbers, and build readable messages from strings and template literals. Then check each result against what a brief asks for, and build a pizza-party bill.

Title image for Compare and Convert (A hiker with a trekking pole watches a machine turn weight tags into number blocks, weigh a backpack against a limit dial, and light a TOTAL TRUE screen with a receipt.)

Course

Compare and Convert

Write JavaScript that answers yes-or-no questions with comparisons, turns numeric text into numbers you can calculate with, and keeps those numbers apart from formatted output. Then you'll build the core of an adventure-pack checker.

Make Decisions in Your Programs

Teach your programs to choose. You’ll run code only when a condition holds, pick one path from several, combine conditions, clean up typed text, and check input before you trust it.

Title image for Decisions in JavaScript (A developer flips a TRUE/FALSE lever on a clay ticket machine whose IF, ELSE IF, and ELSE chutes sort day-trip tickets into green, yellow, and red bins.)

Course

Decisions in JavaScript

Teach your JavaScript programs to decide: run code only when a condition holds, choose one path with else if, combine conditions with &&, || and !, clean text with string methods, and check input safely before you use it.

Write Your Own Functions

Now that your programs can make decisions, you’ll stop repeating the same lines in several places. You’ll write small functions that take values in and hand an answer back, place each variable where the code that needs it can see it, and combine several functions into one small program.

Title image for Functions in JavaScript (A developer presses an arcade button as star tokens ride a conveyor into stacked boxes labeled SCORE, RANK and MESSAGE, which pass numbers down to a RETURN printer.)

Course

Functions in JavaScript

Learn to write small JavaScript functions that take values and return answers, then combine them into an arcade score toolkit that works out each player's score, rank, and message.

Repeat Work and Ask Questions

With functions in hand, you’ll teach your programs to repeat. You’ll count, add up totals, and step through text with loops, then plan a program before you write it and ask the player questions in the terminal, checking each answer before you use it.

Title image for Loops and Terminal Input (A developer types a guess at a terminal console beside a loop machine with numbered tokens on a ring labeled WHILE, a BREAK lever, and HIGHER and LOWER feedback panels.)

Course

Loops and Terminal Input

Make your programs repeat with while and for loops, leave a loop early with break and continue, plan before you code, and ask questions in the terminal as you build a secret-code guessing game in Node.

Organize Data in Lists and Records

With loops and functions in hand, you’ll keep many values together. You’ll store a list in an array and write functions that count, total, select, and find items, with a clear answer even when the list is empty. Then you’ll describe things with named fields in objects, work with lists of those records, and finish with a small program of your own that combines everything from this path.

Title image for Lists With Arrays (A developer with a clipboard checks expedition supply crates riding a conveyor over index tags 0 to 4, past a FOR...OF scanner and a TOTAL scale, toward LENGTH and FIRST MATCH panels.)

Course

Lists With Arrays

Write JavaScript functions that answer questions about a list: build an array, loop over its items, then count, total, select, and find what you need, with a clear answer even when the list is empty.

Title image for Records With Objects (A developer turns dials on a console with a card reading Title, Players and Minutes while a robot arm lifts a board game from a shelf onto a conveyor marked Find by ID beside an Update button.)

Course

Records With Objects

Describe one thing with named fields in a JavaScript object, keep a list of those records, and write functions that select, find by id and update them. Build a board-game shelf helper, then a small records program of your own.

Test Your Knowledge

You’ve made it through the whole path! In the wrap-up quiz below, you’ll revisit the most important ideas: reading errors, working with numbers and text, making decisions, writing functions and loops, and answering questions with arrays and objects. Use it to spot any topics that still feel shaky.

Title image for JavaScript Basics (A developer holds up a toy robot beside a machine that turns blocks into programs through LOG, IF, FUNCTION, LOOP, and ARRAY stations.)

Interactive Quiz

JavaScript Basics

Check what you learned in the JavaScript Basics path: output, values, decisions, functions, loops, arrays, and objects.

Congratulations on completing this learning path! You can now write and run JavaScript programs on your own computer, work with numbers and text, make decisions, repeat work with loops, organize code into functions, and keep data in arrays and objects. You can also check your results and explain how your program reached them.

You might also be interested in this related learning path:

Got feedback on this learning path?

Looking for real-time conversation? Visit the RealJS Community Chat or join the next “Office Hours” Live Q&A Session. Happy coding!

« Browse All Learning Paths