Pure JS Flashcards

1
Q

A primitive data type that represents the absence of a value.

A

null

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A primitive data type that is the value of a variable or object that has not been initialized, or of a function that returns no value.

A

undefined

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A block of JavaScript code that you define once, and can invoke over and over again.

A

Function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A function defined in an object

A

Method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Name the all the Primitive Types

A

Numbers, Strings, Booleans, Null, and Undefined

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Name the Object Types

A

Arrays, Functions, and Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Functions that are written to be used (with the new operator) to initialize a newly created object.

A

Constructor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Any JavaScript type that can be changed, like objects and arrays.

A

Mutable Type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Any JavaScript type that cannot be changed, like numbers, strings, booleans, null, undefined.

A

Immutable Type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Variables declared inside a function have function scope and are visible only to code that appears inside that function.

A

Local Scope

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

A global primitive number that represents when something is not a number

A

NaN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Values that evaluate to boolean true or false but that aren’t actually boolean values of true or false.

A

Truthy or Falsey

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Truthy Examples

A

Everything that is not “Falsey”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Falsey Examples

A

false, 0, “” (empty string), null, undefined, NaN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Boolean Comparison Operators

A

&& (and), || (or), ! (not)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Globally defined symbols that are available to a JavaScript program like undefined, Infinity, NaN, isNaN(), parseInt(), eval(), Date(), RegExp(), String()

A

Global Object/Global Function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Literal

A

A data value that appears directly in a program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is an Immediately-Invoked Function Expression?

A

(function(){ // …do something… })();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is a Closure?

A

A function that returns another function. It makes it possible for a function to have “private” variables.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Function Declaration

A

function doSomething(){ // …do something… };

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Function Expression

A

var doSomething = function(){ // …do something… };

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Boolean

A

Something with the value of True or False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Statement

A

var statement = “I am a statement”; console.log(“I am also a statement!”); myFunction(); // I am a statement too; Statements are the instructions of a computer program – they are executed by the computer and perform some action or computation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Fixed Values

A

Literals ex: Numbers, strings, expressions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Variable Values
Variables are used to store data values for a later time. Ex: var myVariable = "literal string";
26
Reserved Words
words that have special meaning attached to them. There are dozens. a few examples are: break, for, if, null, etc...
27
Comments
// This is a one-line comment /\* This is a multiple line (or block) comment \*/
28
camelCase
JS convention where you capitalize every new word besides the first. Ex: thisIsAnExampleOfCamelCase
29
Equality Operators
=== or !==
30
Comparison Operators
, \>=, \<=
31
Order of Operations
(), !, &&, ||; // in that order
32
Ternary Operator
variableToSet = (conditionToCheck) ? :
33
== vs. ===
The difference is that === will also check to make sure the 'type' of the two operands are the same. Example: 0 == "0" // true 0 === "0" // false
34
code that repeats the doing of a specific task one or more times based upon certain conditions
loop
35
Types of loops
While, do, for
36
While Loop
performs a task for an unknown number of iterations, but while a condition is true. Example: var num = 0; while(num \<= 100){ console.log(num); num++; }
37
Do Loop
same as while loop, but performs the task at least one time in spite of the conditions veracity. Example: var num = 105; do { console.log(num); num++; } while (num \<= 100);
38
For loop
performs a task for a specified number of iterations. Example: var echo = "hello…"; for (var i = 0; i \>= 0; i++){ console.log(echo); }
39
Break
Reserved keyword that ends a loop early. Example: var count = 0; while (true) { console.log(count); count++; if (count \> 10) break; // exit the loop }
40
IIFE
Immediately-invoked Function Expression
41
null
A primitive data type that represents the absence of a value.
42
undefined
A primitive data type that is the value of a variable or object that has not been initialized, or of a function that returns no value.
43
Function
A block of JavaScript code that you define once, and can invoke over and over again.
44
Method
A function defined in an object
45
Numbers, Strings, Booleans, Null, and Undefined
Name the all the Primitive Types
46
Arrays, Functions, and Objects
Name the Object Types
47
Constructor
Functions that are written to be used (with the `new` operator) to initialize a newly created object.
48
Mutable Type
Any JavaScript type that can be changed, like objects and arrays.
49
Immutable Type
Any JavaScript type that cannot be changed, like numbers, strings, booleans, `null`, `undefined`.
50
Local Scope
Variables declared inside a function have function scope and are visible only to code that appears inside that function.
51
NaN
A global primitive number that represents when something is not a number
52
Truthy or Falsey
Values that evaluate to boolean true or false but that aren't actually boolean values of true or false.
53
Everything that is not "Falsey"
Truthy Examples
54
false, 0, "" (empty string), null, undefined, NaN
Falsey Examples
55
`&&` (and), || (or), ! (not)
Boolean Comparison Operators
56
Global Object/Global Function
Globally defined symbols that are available to a JavaScript program like undefined, Infinity, NaN, isNaN(), parseInt(), eval(), Date(), RegExp(), String()
57
A data value that appears directly in a program
Literal
58
(function(){ // ...do something... })();
What is an Immediately-Invoked Function Expression?
59
A function that returns another function. It makes it possible for a function to have "private" variables.
What is a Closure?
60
function doSomething(){ // ...do something... };
Function Declaration
61
var doSomething = function(){ // ...do something... };
Function Expression
62
Something with the value of True or False
Boolean
63
var statement = “I am a statement”; console.log("I am also a statement!”); myFunction(); // I am a statement too; Statements are the instructions of a computer program – they are executed by the computer and perform some action or computation.
Statement
64
Literals ex: Numbers, strings, expressions
Fixed Values
65
Variables are used to store data values for a later time. Ex: var myVariable = "literal string";
Variable Values
66
words that have special meaning attached to them. There are dozens. a few examples are: break, for, if, null, etc...
Reserved Words
67
// This is a one-line comment /\* This is a multiple line (or block) comment \*/
Comments
68
JS convention where you capitalize every new word besides the first. Ex: thisIsAnExampleOfCamelCase
camelCase
69
=== or !==
Equality Operators
70
, \>=, \<=
Comparison Operators
71
(), !, &&, ||; // in that order
Order of Operations
72
variableToSet = (conditionToCheck) ? :
Ternary Operator
73
The difference is that === will also check to make sure the 'type' of the two operands are the same. Example: 0 == "0" // true 0 === "0" // false
== vs. ===
74
loop
code that repeats the doing of a specific task one or more times based upon certain conditions
75
While, do, for
Types of loops
76
performs a task for an unknown number of iterations, but while a condition is true. Example: var num = 0; while(num \<= 100){ console.log(num); num++; }
While Loop
77
same as while loop, but performs the task at least one time in spite of the conditions veracity. Example: var num = 105; do { console.log(num); num++; } while (num \<= 100);
Do Loop
78
performs a task for a specified number of iterations. Example: var echo = "hello…"; for (var i = 0; i \>= 0; i++){ console.log(echo); }
For loop
79
Reserved keyword that ends a loop early. Example: var count = 0; while (true) { console.log(count); count++; if (count \> 10) break; // exit the loop }
Break
80
Immediately-invoked Function Expression
IIFE