javascript Flashcards
1
Q
can you put a script tag anywhere in html?
A
yes, in either the body and/or the head
2
Q
recommended usage of javascript in html file
A
link a file, script src=’./filename’, makes reusability easier
3
Q
best method for importing js
A
put it in head because it is read first
4
Q
js’ 3 basic data types
A
number, boolean, string
5
Q
which variable declaration is mutable
A
let: let can be reassigned, const cannot
6
Q
difference between double and triple equal to
A
“5”==5 will valuate as true. “5”===5 will valuate as false, stricter.
7
Q
write on the page with js
A
document.write()
8
Q
write on console js
A
console.log()
9
Q
show a pop up
A
alert()
10
Q
two types of comments
A
/**/ multi-line. // single-line