Decisions in JavaScript

Martin Breuss 18 Lessons 4h 23m Updated basics js

In this course, your Node scripts learn to make choices. You’ll turn stated rules into code that runs only when a condition holds, pick exactly the right branch from several, and check typed answers before trusting them.

You’ll learn how to:

  • Run code only sometimes with if, and choose one path with else if and else
  • Decide between separate if statements, an else if chain, and a nested if
  • Combine conditions with &&, ||, and !
  • Clean and check text with string methods like trim(), toLowerCase(), and includes()
  • Use truthy and falsy values, pick sensible defaults, and validate input in a safe order

You’ll finish by building a day-trip ticket checker that cleans a visitor’s answers, rejects ages it can’t price, and returns the right price from a published rule table. Along the way, you’ll practice in short local scripts and in on-site coding exercises with automatic feedback.

What’s Included:

  • 18 Lessons
  • Video Subtitles and Full Transcripts
  • Translated Subtitles in 8 Languages
  • 2 Downloadable Resources
  • Interactive Quiz to Check Your Progress
  • 7 Hands-On Coding Exercises
  • Q&A With JavaScript Experts: Ask a Question
  • Certificate of Completion

Downloadable Resources:

Related Learning Paths:

About Martin Breuss

Martin is Head of Content Strategy at RealJS. He came to programming from biology and has been teaching programming for more than ten years, as a coding mentor, code reviewer, curriculum developer, bootcamp instructor, and instructional designer.

» More about Martin

← Browse All Courses