Loading lesson path
JavaScript
Build the mental model first: syntax, variables, control flow, functions, objects, and the runtime basics.
JavaScript is easy to learn.
The JavaScript syntax defines two types of values:
The Assignment Operator = assigns values
Use the JavaScript if statement to execute a block of code when a condition is true .
Loops can execute a block of code a number of times.
- First the idea - Then how to make them - Then how to use them
Scope determines the accessibility (visibility) of variables.
A JavaScript variable can hold 8 types of data.
Always use the same coding conventions for all your JavaScript projects.
JavaScript is the programming language of the web.
A computer program is a list of "instructions" to be "executed" by a computer.
Arithmetic operators perform arithmetic on numbers (literals or variables).
Use the else statement to specify a block of code to be executed if a condition is false .
For Loops can execute a block of code a number of times.
Functions are reusable code blocks designed to perform a particular task.
A code block or block statement is a group of statements enclosed within curly braces { } .
A JavaScript variable can hold 8 types of data.
Avoid global variables, avoid new , avoid == , avoid eval()
In HTML, JavaScript code is inserted between <script> and </script> tags.
JavaScript comments can be used to explain JavaScript code, and to make it more readable.
Assignment operators assign values to JavaScript variables.
The conditional operator is a shorthand for writing conditional if...else statements.
While loops execute a block of code as long as a specified condition is true.
A JavaScript function runs when it is called .
Hoisting is JavaScript's default behavior of moving declarations to the top.
A JavaScript variable can be either a Primitive type or an Object type.
This chapter points out some common JavaScript mistakes.
JavaScript can "display" data in different ways:
JavaScript variables are containers for data.
Comparison operators are used to compare two values .
Based on a condition, switch selects one or more code blocks to be executed .
The break statement "jumps out" of loops and switches.
Parameters allow you to pass (send) values to a function.
The "use strict" directive was new in ECMAScript version 5.
The typeof operator returns the data type of a JavaScript variable.
How to speed up your JavaScript code.
The let keyword was introduced in ES6 (2015)
Conditional Statements allow us to perform different actions for different conditions .
In JavaScript, a Boolean is a primitive data type that can only have one of two values:
The continue statement skips the current iteration in a loop.
A function can return a value back to the code that called it.
The JavaScript toString() method converts a variable (or a value) to a string.
The const keyword was introduced in ES6 (2015)
Logical operators are used to combine boolean expressions .
Control Flow is the order in which statements are executed in a program.
In JavaScript, function parameters and arguments are distinct concepts:
- Converting Strings to Numbers - Converting Numbers to Strings - Converting Dates to Numbers - Converting Numbers to Dates - Converting Booleans to Numbers - Converting Numbers to Booleans
A JavaScript variable can hold 8 types of data:
A function expression is a function stored in a variable .
The destructuring assignment syntax can unpack objects into variables:
Arrow Functions allow a shorter syntax for function expressions .