JavaScript - Test 1


Programing skills - JavaScript - Math
1. Between which HTML tags do we put the JavaScript?





2. JavaScript and Java are the same.



3. Where is the correct place to insert a JavaScript?





4. What is the correct syntax for including an external script called "sample1.js"?





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



6. How to write "Hello World!" message in JavaScript?





7. How to create a function in JavaScript?






8. How to call a function named "myFunction"?




9. How can you write a comment in a JavaScript?




10. How to write an IF statement in JavaScript?





11. How to execute some code if "i" is NOT equal to 2?





12. How does a WHILE loop start?




13. How does a FOR loop start?





14. How to write a comment that has more than one line?




15. What is the correct way to write a JavaScript array?





16. How to round the number 3.14, to the nearest integer?






17. How to find which number has the highest value (x and y)?






18. What is the correct JavaScript syntax for opening a new window?




19. What is the correct JavaScript syntax to change the content of the HTML element below?

<p id="demo">This is a demo text.</p>







20. How to detect the client's browser name?