Java Script commands Flashcards

1
Q

add embedded string

A

${ }

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

3 main variables

A

var
let
const

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

Extracting part of a string

A

slice (start, end) - takes a slice
substring
substr - specifies length

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

convert string to upper and lower case

A

toUpperCase()
toLowerCase()

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

remove white space

A

trim()

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

add padding to start of string

A

padStart(X,”Y”) - pad start with letter Y until it reaches X characters

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

convert a number to a string

A

toString()

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

case sensitive replace string

A

.replace(“this” , “that”) - replaces ‘this’ with ‘that’.

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

case insensitive replace string

A

.repace(/this/i , “that)

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

conditional

A

if (condition) {run this code }
else {run this code}

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