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
Q

Variable Values

A

Variables are used to store data values for a later time. Ex: var myVariable = “literal string”;

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

Reserved Words

A

words that have special meaning attached to them. There are dozens. a few examples are: break, for, if, null, etc…

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

Comments

A

// This is a one-line comment /* This is a multiple line (or block) comment */

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

camelCase

A

JS convention where you capitalize every new word besides the first. Ex: thisIsAnExampleOfCamelCase

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

Equality Operators

A

=== or !==

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

Comparison Operators

A

, >=, <=

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

Order of Operations

A

(), !, &&, ||; // in that order

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

Ternary Operator

A

variableToSet = (conditionToCheck) ? :

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

== vs. ===

A

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
Q

code that repeats the doing of a specific task one or more times based upon certain conditions

A

loop

35
Q

Types of loops

A

While, do, for

36
Q

While Loop

A

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
Q

Do Loop

A

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
Q

For loop

A

performs a task for a specified number of iterations. Example: var echo = “hello…”; for (var i = 0; i >= 0; i++){ console.log(echo); }

39
Q

Break

A

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
Q

IIFE

A

Immediately-invoked Function Expression

41
Q

null

A

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

42
Q

undefined

A

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
Q

Function

A

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

44
Q

Method

A

A function defined in an object

45
Q

Numbers, Strings, Booleans, Null, and Undefined

A

Name the all the Primitive Types

46
Q

Arrays, Functions, and Objects

A

Name the Object Types

47
Q

Constructor

A

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

48
Q

Mutable Type

A

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

49
Q

Immutable Type

A

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

50
Q

Local Scope

A

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

51
Q

NaN

A

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

52
Q

Truthy or Falsey

A

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

53
Q

Everything that is not “Falsey”

A

Truthy Examples

54
Q

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

A

Falsey Examples

55
Q

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

A

Boolean Comparison Operators

56
Q

Global Object/Global Function

A

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

57
Q

A data value that appears directly in a program

A

Literal

58
Q

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

A

What is an Immediately-Invoked Function Expression?

59
Q

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

A

What is a Closure?

60
Q

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

A

Function Declaration

61
Q

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

A

Function Expression

62
Q

Something with the value of True or False

A

Boolean

63
Q

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.

A

Statement

64
Q

Literals ex: Numbers, strings, expressions

A

Fixed Values

65
Q

Variables are used to store data values for a later time. Ex: var myVariable = “literal string”;

A

Variable Values

66
Q

words that have special meaning attached to them. There are dozens. a few examples are: break, for, if, null, etc…

A

Reserved Words

67
Q

// This is a one-line comment /* This is a multiple line (or block) comment */

A

Comments

68
Q

JS convention where you capitalize every new word besides the first. Ex: thisIsAnExampleOfCamelCase

A

camelCase

69
Q

=== or !==

A

Equality Operators

70
Q

, >=, <=

A

Comparison Operators

71
Q

(), !, &&, ||; // in that order

A

Order of Operations

72
Q

variableToSet = (conditionToCheck) ? :

A

Ternary Operator

73
Q

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

A

== vs. ===

74
Q

loop

A

code that repeats the doing of a specific task one or more times based upon certain conditions

75
Q

While, do, for

A

Types of loops

76
Q

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++; }

A

While Loop

77
Q

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);

A

Do Loop

78
Q

performs a task for a specified number of iterations. Example: var echo = “hello…”; for (var i = 0; i >= 0; i++){ console.log(echo); }

A

For loop

79
Q

Reserved keyword that ends a loop early. Example: var count = 0; while (true) { console.log(count); count++; if (count > 10) break; // exit the loop }

A

Break

80
Q

Immediately-invoked Function Expression

A

IIFE