Javascript · Introduction to JavaScript
What is JavaScript?
The full text of this chapter, to read or revisit. To practise, do the exercises.
▶ Do the exercises
Exercise 1 — Welcome to JavaScript!
JavaScript is a programming language that brings websites and applications to life, and it's one of the most popular in the world. It's what makes a page interactive, working alongside HTML (for structure) and CSS (for styling).
For now, we'll focus on pure JavaScript - learning the language itself without mixing in other technologies.
JavaScript vs Java
Despite the similar names, JavaScript and Java are completely different programming languages! It's like comparing a car and a carpet - they both start with "car" but they're totally different things.
Exercise 2 — What is JavaScript?
Which of the following best describes JavaScript?
Options
• A programming language used to create interactive websites and applications
• A styling language used to make websites look pretty
• The same language as Java but with a longer name
• A markup language used to structure web pages
Hint : Remember that JavaScript is a programming language, not a styling or markup language. It's also completely different from Java despite the similar name.
Exercise 3 — What Can JavaScript Do?
JavaScript is incredibly powerful and versatile. Here are some things you can create with JavaScript:
- Websites: Allows to make button clickable, send form, display data in a smart way, plenty of things! - Games: JavaScript can create everything from simple puzzle games to complex multiplayer experiences - Mobile apps: With frameworks like React Native, you can use JavaScript to build apps for phones and tablets
The list goes on, but let's not get ahead of ourselves. First, we'll start with the basics of the language itself!
Exercise 4 — Web Technologies: What Does Each Do?
Match each web technology with its primary purpose:
Items to match
• JavaScript
• HTML
• CSS
Definitions
• Makes websites interactive and adds behavior
• Structures the content of web pages
• Styles and designs the appearance of web pages
Exercise 5 — Why Start with Pure JavaScript?
In this course, we're starting by learning pure JavaScript before mixing it with HTML and CSS. Why is this a good approach?
Options
• It helps you learn the fundamentals of JavaScript without getting confused by multiple technologies at once
• Because HTML and CSS are not important for web development
• JavaScript cannot work with HTML and CSS
• Pure JavaScript is the only way JavaScript is used in real projects
Hint : Learning pure JavaScript first helps you understand the language itself. Later, you'll combine it with HTML and CSS, but starting with the basics makes everything clearer.
Back to the course