JavaScript | The School of Code

Settings

Appearance

Choose a typography theme that suits your style

JavaScript

Learn JavaScript from basics to advanced concepts.

1

Hello World

Every programmer’s journey begins with “Hello, World!”. In JavaScript, we use console.log() to print output to the console.

Example

Run this example to see how it works and then try the exercise.

example.js
Loading...
Output
Click "Run" to see the example in action...
Exercise

Your task: Print "Hello, World!" to the console

main.js
Loading...
Output
Click "Run" to execute your code...
Quiz

Which method is used to print output to the console in JavaScript?

SUMMARY

In this section, you learned how to print output to the console. Next, you'll learn how to declare variables using let and const.

2

Variables with let and const

Variables store data. Use let for values that change and const for constants that stay the same.

Example

Run this example to see how it works and then try the exercise.

example.js
Loading...
Output
Click "Run" to see the example in action...
Exercise

Your task: Create two variables: greeting and name

main.js
Loading...
Output
Click "Run" to execute your code...
Quiz

What keyword should you use for a variable that will never change?

SUMMARY

In this section, you learned how to declare variables using let and const. Next, you'll learn how to perform mathematical operations.

3

Arithmetic Operations

JavaScript supports standard arithmetic operators with specific precedence rules.

Example

Run this example to see how it works and then try the exercise.

example.js
Loading...
Output
Click "Run" to see the example in action...
Exercise

Your task: Calculate the area of a rectangle

main.js
Loading...
Output
Click "Run" to execute your code...
Quiz

What is the result of 10 + 5 * 2 in JavaScript?

SUMMARY

In this section, you learned how to perform mathematical operations. Next, you'll learn how to manipulate and work with strings.

Unlock 10 More Lessons

You've completed the free preview! Upgrade to Pro to access all 12 lessons in this course, plus advanced projects and certificates.

Locked lessons:
  • String Operations
  • Conditionals
  • For Loops
  • While Loops
  • Functions
  • Arrays
  • Objects
  • Array Methods: map, filter, reduce
  • Final Project: Task Manager
Hello World 1
Variables with let and const 2
Arithmetic Operations 3
Unlock 10 more lessons Access all content with Pro
Upgrade
String Operations 4 Conditionals 5 For Loops 6 While Loops 7 Functions 8 Arrays 9 Objects 10 Array Methods: map, filter, reduce 11 Final Project: Task Manager 12

Reset Progress?

Are you sure you want to reset all progress for this course? This action cannot be undone.