Every programmer’s journey begins with “Hello, World!”. In JavaScript, we use console.log() to print output to the console.
JavaScript
Learn JavaScript from basics to advanced concepts.
Hello World
Run this example to see how it works and then try the exercise.
Click "Run" to see the example in action...Your task: Print "Hello, World!" to the console
Click "Run" to execute your code...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.
Variables with let and const
Variables store data. Use let for values that change and const for constants that stay the same.
Run this example to see how it works and then try the exercise.
Click "Run" to see the example in action...Your task: Create two variables: greeting and name
Click "Run" to execute your code...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.
Arithmetic Operations
JavaScript supports standard arithmetic operators with specific precedence rules.
Run this example to see how it works and then try the exercise.
Click "Run" to see the example in action...Your task: Calculate the area of a rectangle
Click "Run" to execute your code...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.
- String Operations
- Conditionals
- For Loops
- While Loops
- Functions
- Arrays
- Objects
- Array Methods: map, filter, reduce
- Final Project: Task Manager