• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/14

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

14 Cards in this Set

  • Front
  • Back

What are primitives?

Primitives are values, they have no properties. A primitive can be referenced by a property.


A primitive can be referenced by a property.


A primitive can be referenced by a property.

What are the types of primitives?

Undefined, null, boolean, string and number

What is garbage collection?

The automatic process by which JavaScript clears blocks of memory for data that is no longer in use.

What are the types of objects?

Math


Date


JSON


window


Document


Objects the programmer creates


Array


Function



Sometimes primitives are objects too (numbers, booleans, strings) when a property or method is called on it it is temporarily converted to an object to return a value, it is then converted back to a primitive.



Basically everything in JavaScript is an object

What is an object?

An object is a collection of properties and a property is an association between a name (or key) and a value. A properties value can be a function in which case the property is known as a method.

What is a method?

A properties value can be a function, in which case the property if known as a method.

What is immutability?

An immutable value is one which cannot be changed. Examples include strings and numbers, they cannot be changed, only new strings and numbers can be created.

What is event binding?

Event binding refers to telling the browser that a particular function should be called whenever some event occurs.

What is const?

Const is a variable which cannot be rebinded. Once you bind a value/object to a const variable you can't reassign to that variable.



const something = {};


something = 10; //error



let somethingElse = {};


somethingElse = 1000; //this is fine



const does not make something immutable.



const myArray = [];


myArray.push(10)//this works fine.

What is let?

In es6 let is basically the new car but has a new kind of scope called block scoping. Unlike const, let can be binded to a new data type after being created.

What is the || operator?

Is a logical operator. It means or. When used in an if statement with boolean values, if either operand (a || b) is true it evaluates to true. If both are false it is false.



|| Returns the value of one of the specified operands. If the first is false, the second will be returned. If it is a non boolean value, it will return the value as it is.

What if the && operator?

A logical operator. Returns true if both a && b are true.


If a is false it will return the value of b. If used with non boolean values it will return whatever the value is.

What is the ! Operator?

It is a logical operator. Returns false if it's operand can be converted to true and returns true if it's operand can be converted to false.



const a = false;


!a = true;


a = true;


a = false;


!a = true;

What is block scoping?

Block scoping is when a variable is available within the block it's created in and isn't hoisted to the function it's a part of. 'let' allows block scoping while 'var' is hoisted to the scope if the function it's in and not the block.