All Flashcards

(78 cards)

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
if else statement syntax
if (condition) { code to run if condition is true} else if (other condition){ code to run if other condition is true}
26
switch statement syntax
switch(expression) { case x: // code block break; case y: // code block break; default: // code block }
27
while loop syntax
while (condition) { code to run while condition is true; counter to end loop; }
28
symbol to increase 1
++
29
symbol to decrease 1
--
30
function syntax
function nameFunction (parameter) { function body }
31
parameters
names listed in function definition. not actually run but a placeholder
32
argument
the values passed into function.
33
return definition
statement that ends function execution and specifies a value to be returned to the function caller
34
what does parseInt() do
turns numbers inside strings from string to numbers. parseInt("2") becomes 2
35
what are data in arrays identified with
Index
36
.length does what in an Array
finds the number of elements in the array
37
what is the index of the first number in an array
0
38
how do you rename an element in an array
array[index to change]= "new element"
39
how do you reach a nested array for 3 [1,2 ,[3]]
[0][0]
40
.push ()
add to end of array destructively
41
.unshift ()
add to beginning of an array destructively
42
how to add non destructively
spread operator
43
what is spread operator symbol
...
44
example of using spread operator to add to end of array
newArray= [...array, "element to add"]
45
example of using spread operator to add to beginning of array
newArray = ["element to add", ... array]
46
.pop()
removes last element of array destructively
47
.shift()
removes first element of array destructively
48
how to remove elements non destructively
.slice()
49
using .slice ()
const newArray= array.slice(start index, stop index)
50
how to get last element of array
-1
51
what can .splice do
add, remove or replace
52
.splice syntax
array.splice(start index, end index, "new element")
53
object syntax
const obj = { key 1 : value 1, key 2: { innerkey 1: innervalue 1, } }
54
dot notation
way to access value stored in object
55
dot notation syntax
object. key
56
bracket notation
uses brackets [ ] to access objects
57
bracket syntax for objects
object ["key"]
58
object.keys ()
pulls all of the key at the top level in a object
59
object.values()
returns all of the object values not the keys
60
adding properties to objects with dot notation
object.key = new value
61
adding properties to objects with brackets
object["key"] = value
62
how to remove an element in array
delete object.key
63
nondestructive add to object
use spread operator (...) const newobject = {... object} newobject["Key"] = value
64
for loop syntax
for ( initialization; condition; iteration) { code that runs for each pass }
65
for loop initialization
counter variable. example= let age = 20
66
for loop condition
expression to evaluate before each loop pass. example: age < 40
67
for loop iteration
what happens at the end of the loop. example: age ++
68
what is looping
process of executing a set of statements repeatedly until a condition is met
69
what is iteration
process of executing a set of statements once for each element in a collection
70
what is used for iteration in arrays
for ... of
71
for... of syntax
const array1 = ['a', 'b', 'c']; for (const element of array1) { console.log(element); }
72
iterating over strings
for... of
73
iterating over objects
for ... in
74
for ... in syntax to return key
for (const [key] in [object]) { console.log(key); }
75
for ... in syntax to return key
for (const [key] in [object]) { console.log(object['key']); }
76
what makes a copy of an object
object assign({}, object)
77
.map
loops through array and return a new array without changing the original array
78
.map syntax
const newFunctionName = object.map(function(item)){ return item.key }