All Flashcards

1
Q

what is an operator

A

+, -, =, <

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

what are the 7 data types

A

numbers, strings, boolean, symbols, objects, null, undefined

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

what does Typeof do

A

operator that tells the data type

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

Numbers

A

1, 3, .87, -4

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

strings

A

letters. represent text using ‘’

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

Booleans

A

true or false

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

objects

A

collection of data

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

what does objects include

A

key and values in {} brackets

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

Arrays

A

list of values in square brackets []

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

Null

A

intentionally absent object or not a possible value

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

undefined

A

not yet assigned a value

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

interpolation

A

back ticked ` ` can be used for string

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

interpolation operations

A

${ insert value}

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

how can you combine strings

A

string + string

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

boolean expression

A

expressions that return true or false (1 > 0)

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

what data types are falsey

A

false, null, undefined, 0, NaN, empty string “ “

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

what are strict equality operator

A

===

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

what are strict inequality operator

A

! ==

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

what is not operator

A

!

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

what is and operator

A

&&

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

what is or operator

A

||

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

tenary expression syntax

A

true or false value ? return if true : return if false

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

if statement syntax

A

if (condition) {
code to run if condition is true}

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

else statement syntax

A

if (condition) {
code to run if condition is true} else {
code to run if condition is false}

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

if else statement syntax

A

if (condition) {
code to run if condition is true} else if (other condition){
code to run if other condition is true}

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

switch statement syntax

A

switch(expression) {
case x:
// code block
break;
case y:
// code block
break;
default:
// code block
}

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

while loop syntax

A

while (condition) {
code to run while condition is true;
counter to end loop;
}

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

symbol to increase 1

A

++

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

symbol to decrease 1

A

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

function syntax

A

function nameFunction (parameter) {
function body
}

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

parameters

A

names listed in function definition. not actually run but a placeholder

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

argument

A

the values passed into function.

33
Q

return definition

A

statement that ends function execution and specifies a value to be returned to the function caller

34
Q

what does parseInt() do

A

turns numbers inside strings from string to numbers. parseInt(“2”) becomes 2

35
Q

what are data in arrays identified with

A

Index

36
Q

.length does what in an Array

A

finds the number of elements in the array

37
Q

what is the index of the first number in an array

A

0

38
Q

how do you rename an element in an array

A

array[index to change]= “new element”

39
Q

how do you reach a nested array for 3 [1,2 ,[3]]

A

[0][0]

40
Q

.push ()

A

add to end of array destructively

41
Q

.unshift ()

A

add to beginning of an array destructively

42
Q

how to add non destructively

A

spread operator

43
Q

what is spread operator symbol

A

44
Q

example of using spread operator to add to end of array

A

newArray= […array, “element to add”]

45
Q

example of using spread operator to add to beginning of array

A

newArray = [“element to add”, … array]

46
Q

.pop()

A

removes last element of array destructively

47
Q

.shift()

A

removes first element of array destructively

48
Q

how to remove elements non destructively

A

.slice()

49
Q

using .slice ()

A

const newArray= array.slice(start index, stop index)

50
Q

how to get last element of array

A

-1

51
Q

what can .splice do

A

add, remove or replace

52
Q

.splice syntax

A

array.splice(start index, end index, “new element”)

53
Q

object syntax

A

const obj = {
key 1 : value 1,
key 2: {
innerkey 1: innervalue 1,
}
}

54
Q

dot notation

A

way to access value stored in object

55
Q

dot notation syntax

A

object. key

56
Q

bracket notation

A

uses brackets [ ] to access objects

57
Q

bracket syntax for objects

A

object [“key”]

58
Q

object.keys ()

A

pulls all of the key at the top level in a object

59
Q

object.values()

A

returns all of the object values not the keys

60
Q

adding properties to objects with dot notation

A

object.key = new value

61
Q

adding properties to objects with brackets

A

object[“key”] = value

62
Q

how to remove an element in array

A

delete object.key

63
Q

nondestructive add to object

A

use spread operator (…)
const newobject = {… object}
newobject[“Key”] = value

64
Q

for loop syntax

A

for ( initialization; condition; iteration) {
code that runs for each pass
}

65
Q

for loop initialization

A

counter variable. example= let age = 20

66
Q

for loop condition

A

expression to evaluate before each loop pass. example: age < 40

67
Q

for loop iteration

A

what happens at the end of the loop. example: age ++

68
Q

what is looping

A

process of executing a set of statements repeatedly until a condition is met

69
Q

what is iteration

A

process of executing a set of statements once for each element in a collection

70
Q

what is used for iteration in arrays

A

for … of

71
Q

for… of syntax

A

const array1 = [‘a’, ‘b’, ‘c’];

for (const element of array1) {
console.log(element);
}

72
Q

iterating over strings

A

for… of

73
Q

iterating over objects

A

for … in

74
Q

for … in syntax to return key

A

for (const [key] in [object]) {
console.log(key);
}

75
Q

for … in syntax to return key

A

for (const [key] in [object]) {
console.log(object[‘key’]);
}

76
Q

what makes a copy of an object

A

object assign({}, object)

77
Q

.map

A

loops through array and return a new array without changing the original array

78
Q

.map syntax

A

const newFunctionName = object.map(function(item)){
return item.key
}