javascript Flashcards

1
Q

can you put a script tag anywhere in html?

A

yes, in either the body and/or the head

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

recommended usage of javascript in html file

A

link a file, script src=’./filename’, makes reusability easier

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

best method for importing js

A

put it in head because it is read first

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

js’ 3 basic data types

A

number, boolean, string

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

which variable declaration is mutable

A

let: let can be reassigned, const cannot

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

difference between double and triple equal to

A

“5”==5 will valuate as true. “5”===5 will valuate as false, stricter.

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

write on the page with js

A

document.write()

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

write on console js

A

console.log()

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

show a pop up

A

alert()

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

two types of comments

A

/**/ multi-line. // single-line

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