Section 1

Preview this deck

14. How to insert a comment that has more than one line? //This comment has more than one line// <!--This comment has more than one line--> /*This comment has more than one line*/

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (20)

Section 1

(20 cards)

14. How to insert a comment that has more than one line? //This comment has more than one line// <!--This comment has more than one line--> /*This comment has more than one line*/

Front

C

Back

11. How does a WHILE loop start? while (i <= 10; i++) while i = 1 to 10 while (i <= 10)

Front

C

Back

12. How does a FOR loop start? for i = 1 to 5 for (i <= 5; i++) for (i = 0; i <= 5; i++) for (i = 0; i <= 5)

Front

C

Back

20. How can you detect the client's browser name? client.navName navigator.appName browser.name

Front

B

Back

2. What is the correct JavaScript syntax to write "Hello World"? ("Hello World"); response.write("Hello World"); echo "Hello World"; document.write("Hello World");

Front

D

Back

3. Where is the correct place to insert a JavaScript? The <body> section Both the <head> section and the <body> section are correct The <head> section

Front

B

Back

10. How to write an IF statement for executing some code if "i" is NOT equal to 5? if (i != 5) if i =! 5 then if i <> 5 if (i <> 5)

Front

A

Back

6. How do you write "Hello World" in an alert box? msg("Hello World"); msgBox("Hello World"); alert("Hello World"); alertBox("Hello World");

Front

C

Back

7. How do you create a function in JavaScript? function:myFunction() function = myFunction() function myFunction()

Front

C

Back

13. How can you add a comment in a JavaScript? 'This is a comment //This is a comment <!--This is a comment-->

Front

B

Back

18. What is the correct JavaScript syntax for opening a new window called "w2" ? w2 = window.open("http://www.w3schools.com"); w2 = window.new("http://www.w3schools.com");

Front

A

Back

15. What is the correct way to write a JavaScript array? var colors = 1 = ("red"), 2 = ("green"), 3 = ("blue") var colors = ["red", "green", "blue"] var colors = (1:"red", 2:"green", 3:"blue") var colors = "red", "green", "blue"

Front

B

Back

17. How do you find the number with the highest value of x and y? ceil(x, y) Math.max(x, y) top(x, y) Math.ceil(x, y)

Front

B

Back

1. Inside which HTML element do we put the JavaScript? <scripting> <javascript> <js> <script>

Front

D

Back

4. What is the correct syntax for referring to an external script called "xxx.js"? <script src="xxx.js"> <script name="xxx.js"> <script href="xxx.js">

Front

A

Back

16. How do you round the number 7.25, to the nearest integer? Math.round(7.25) rnd(7.25) Math.rnd(7.25) round(7.25)

Front

A

Back

5. The external JavaScript file must contain the <script> tag. False True

Front

False

Back

9. How to write an IF statement in JavaScript? if i == 5 then if i = 5 then if i = 5 if (i == 5)

Front

D

Back

8. How do you call a function named "myFunction"? call myFunction() call function myFunction() myFunction()

Front

C

Back

19. JavaScript is the same as Java. False True

Front

False

Back