CodeOrbit

šŸ

Orbit Reached

You have completed all mission contexts.

Context 30 / 30

Ready for Liftoff

You now know how to talk to the browser, create storage boxes, and read errors. Your spaceship is fueled. Next, we look at what exactly we can put inside those boxes.

Context 29 / 30

Code Execution: Parsing

Before running anything, the computer quickly scans your whole file to learn where the variables and functions are. This is called parsing.

Context 28 / 30

Strict Mode

Typing 'use strict' at the top of your code turns the computer into a strict teacher. It stops you from making lazy mistakes and forces clean coding habits.

Context 27 / 30

The Window Object

In a browser, the 'Window' is the master container. It represents the actual browser tab you are looking at, and it holds all your code.

Context 26 / 30

JS is not Java

JavaScript and Java have almost nothing in common. Calling them the same is like saying 'Car' and 'Carpet' are the same because they share letters.

Context 25 / 30

History of JS

JavaScript was created in just 10 days in 1995. It was originally built just to make web forms slightly animated, and now it runs everything from websites to rockets.

Context 24 / 30

Debugging

Debugging is the art of being a detective in a crime movie where you are also the murderer. You read the red errors to trace exactly where your code broke.

Context 23 / 30

Reference Errors

This happens when you ask the computer for a box (variable) that doesn't exist yet. You asked for 'fuel', but you never actually created the 'fuel' box.

Context 22 / 30

Syntax Errors

A syntax error means you broke the grammar rules. You forgot a parenthesis, misspelled a word, or missed a quote mark. It's a typo.

Context 21 / 30

What is an Error?

When the computer doesn't understand your command, it throws a red error in the console. Don't panic! It's just the computer saying, 'I need you to clarify this.'

Context 20 / 30

External vs Internal JS

You can write JS directly inside the HTML file, but it's cleaner to put it in its own separate file (like app.js) and link it. It keeps your workspace organized.

Context 19 / 30

The HTML Script Tag

To link your JavaScript to a website, you put a '<script>' tag in your HTML file. It’s the bridge connecting your code to the visual webpage.

Context 18 / 30

Executing Code Top to Bottom

The computer reads your code exactly like a book: line 1, then line 2, then line 3. It won't skip ahead unless you explicitly tell it to.

Context 17 / 30

Interacting: prompt()

To ask the user a question, use 'prompt('What is your name?')'. It gives them a pop-up with a text box to type their answer.

Context 16 / 30

Interacting: alert()

Want to annoy a user? Use 'alert('Warning!')'. It creates a pop-up box on the screen that forces the user to click OK before doing anything else.

Context 15 / 30

Case Sensitivity

JavaScript is extremely strict about capitals. 'apple', 'Apple', and 'APPLE' are treated as three completely different things.

Context 14 / 30

Multi-line Comments

If you have a really long note, you wrap it in '/*' and '*/'. Everything between those symbols is ignored by the machine.

Context 13 / 30

Leaving Comments

Sometimes you want to leave notes for humans that the computer ignores. Putting '//' before text makes it a comment. The computer skips it completely.

Context 12 / 30

The Semicolon ;

A semicolon in JavaScript is like a period at the end of an English sentence. It tells the computer, 'I am done giving this specific instruction.'

Context 11 / 30

Statements vs Expressions

A statement is a full sentence or action (like 'Stand up'). An expression is just a piece of math or a value (like '2 + 2' or 'Hello').

Context 10 / 30

Camel Case Naming

Programmers write multiple words by capitalizing the start of every word except the first. 'mySpaceshipSpeed'—it looks like the humps of a camel!

Context 9 / 30

Rules for Naming Boxes

You can't name a box anything you want. No spaces are allowed, and it can't start with a number. 'myScore' is good, '1st Score' is illegal.

Context 8 / 30

The 'const' Keyword

Sometimes you want a box that can never be opened or changed. We use 'const' for that. 'const gravity = 9.8' means gravity is locked in forever.

Context 7 / 30

Changing Variables

The beauty of 'let' is that the box's contents can change. Later, you can say 'fuel = 50', and the computer throws out the 100 and replaces it with 50.

Context 6 / 30

The 'let' Keyword

We create variables using the word 'let'. Typing 'let fuel = 100' tells the computer: 'Create a box named fuel, and put 100 inside it'.

Context 5 / 30

What is a Variable?

A variable is just a labeled box. If you have a box labeled 'Score' and put the number 10 inside, the computer remembers that 'Score' means 10.

Context 4 / 30

Your First Command

The classic first step is 'console.log()'. Using console.log('Hello, Earth!') is just you printing a message on that dashboard for yourself to read.

Context 3 / 30

The Console Dashboard

Think of the console as your spaceship's dashboard. It’s a hidden panel where the computer talks to you. You can find it by right-clicking a webpage and selecting 'Inspect'.

Context 2 / 30

Where does JS live?

JavaScript lives right inside your web browser. You don't need fancy software to run it; browsers like Chrome or Safari already have a built-in engine to understand it.

Context 1 / 30

What is JavaScript?

Imagine a website is a house. HTML builds the walls, CSS paints them, but JavaScript wires the electricity. It’s what makes the house interactive—turning on lights and opening doors.

← Abort Mission

Lecture 01: Introduction to Javascript

Total Duration: 1 hrs 52 mins 43 secs

Initiate Launch Scroll UP to ignite thrusters