Test your basic knowledge |

Javascript Basics

Subject : it-skills
Instructions:
  • Answer 50 questions in 15 minutes.
  • If you are not ready to take this test, you can study here.
  • Match each statement with the correct term.
  • Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.

This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. Date object method used to return a string containing the date and time






2. Command to display a prompt






3. To denote a string in JavaScript






4. To create a function in JavaScript






5. To assign a default value to a prompt






6. To create a function that returns a value in JavaScript






7. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.






8. Math object method used to return a random number






9. To set focus on the control for textboxes






10. Math object method used to return the absolute value of a given number






11. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available






12. This returns only True or false values






13. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________






14. ________ comments start with / and end with /.






15. To view the current web address using JavaScript






16. To set the control to be disabled for textboxes






17. To code a for statement in JavaScript






18. To display an alert






19. To insert Javascript into a web page






20. String object method used to get the character at a specified index position






21. Number object method used to return a numerical string with the specified number of significant digits






22. Math object method used to return a given number raised to a given power






23. The syntax of a conditional operator






24. To assign the return value of confirm() to a variable






25. Math object method used to return the lowest value for a set of supplied numbers






26. String object method used to return a new string that contains part of the original string from the specified start position and up to but not including the specified stop index






27. To create a new Date object






28. Number object method used to return a number in exponential format with the specified number of decimal places






29. String object method used to concatenate multiple strings






30. To test that a variable contains a valid number






31. To get the current checked status of the control for radio buttons






32. To get the text value of the control for radio buttons






33. Number object method used to round numbers to the specified number of decimal places






34. The string escape sequence to insert a carriage return in JavaScript






35. The string escape sequence to start a new line in JavaScript






36. The four attributes of the <script> tag:Type - Src - _____ and Defer






37. A statement that yields a value






38. Math object method used to return a given number rounded to the next lowest integer value






39. The identity operator for equals






40. The string escape sequence to insert a backslash in JavaScript






41. To create a single line comment in JavaScript






42. To set the digit precision of a decimal number






43. To declare a variable in JavaScript






44. The format to create a new Date object from a string






45. When you __________ a javascript variable it retains its original value






46. Math object method used to return a given number that has been rounded to the closes integer value






47. The events common to most controls: onfocus - onblur - onclick - _______ - onchange - onselect






48. To assign the value from a prompt to a non-string variable






49. To access the text element in a <span> tag






50. To get the current checked status of the control for checkboxes