It is a popular programming language commonly used to create interactive effects within web browsers.
A place to store values, can store any kind of information (data types): numbers, words, collections of data
A variable that has no value
To create a variable - done by using:
var variableName = value;
Set (give) some value to variable.
A set of characters, word(s), phrase. To initialize variable with a string you need to put this string into quotes.
Boolean variable represent a logical value True or False
An ordered list of values, can store different types of data inside
Mathematical operators, such as: +, -, *, /, >, <, = etc
Comments are some notes that you can leave for yourself or another person, a note that a computer will not read. You can write a comment on a new line or on the same line after code as so:
// I’m your comment
Single line comment starts with //
Multi line comment are placed between /* .. */
A separable, reusable piece of code. It takes some input, does some manipulation on it and returns us an output.
To create a function
A value input that functions can accept
if
used to decide which lines of code to execute, else
- to give alternative set of instructions.
Example:
if (x > 5) {
console.log("X bigger than 5");
}
else {
console.log("X smaller than 5");
}
It repeats code over and over again until some condition is met.
This loop is similar to ‘while loop’, just with a set amount of repetition. You declare counter in the statement as so:
for (var i = 0; i < 5; i++) {
do something 5 times
}
A loop that does not stop and it’s a loop that you need to avoid. Each loop should have some condition so it can stop.
A collection of properties
A type of object that is created when a user interacts with a web page. For example, JavaScript creates an event when a user clicks on a button.
Stands for Cascading Style Sheets. CSS describes how HTML elements are to be displayed on screen. It is presentation.
Stands for Hyper Text Markup Language. It is a structure of the elements on the page.
Stands for Document Object Model. It defines the logical structure of documents and the way a document is accessed and manipulated.
Scope is the set of variables, objects, and functions that you can access.
A method of interacting with the system. In order to write to the browser console, you could use console.log(‘Hello World’). This would write Hello World in the browser console.