JS 3 Flashcards

1
Q

How can you add a comment in a JavaScript?

A

<!--This is a comment-->

//This is a comment
‘This is a comment

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

JavaScript is the same as Java.

A

True
False

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

How do you call a function named “myFunction”?

A

call myFunction()
myFunction()
call function myFunction()

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

How do you declare a JavaScript variable?

A

variable carName;
var carName;
v carName;

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

How do you create a function in JavaScript?

A

function myFunction()
function = myFunction()
function:myFunction()

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

How do you round the number 7.25, to the nearest integer?

A

Math.round(7.25)
rnd(7.25)
round(7.25)
Math.rnd(7.25)

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

Is JavaScript case-sensitive?

A

No
Yes

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

Where is the correct place to insert a JavaScript?

A

The <body> section
The <head> section
Both the <head> section and the <body> section are correct

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