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. To assign the value from a prompt to a non-string variable






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






3. To view the current web address using JavaScript






4. Math object method used to return a given number rounded to the next highest integer value






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






6. To create a single line comment in JavaScript






7. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs






8. What Date object method is used to return the number of milliseconds since the start of GMT






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






10. To create a function in JavaScript






11. The syntax of a conditional operator






12. To create a Date object in JavaScript






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






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






15. Date object method used to return a string containing the time






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






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






18. To denote a string in JavaScript






19. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()






20. To set the current value of the control for a text area






21. A statement that yields a value






22. To alter the value of the text element in a span tag






23. To display an alert






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






25. What String object method returns a new string containing the value of the original string but in all lower case






26. To code a while statement in JavaScript






27. String object method used to return the position of the first instance of a specified search string starting from the specified index






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






29. The escape sequence used to insert a Unicode character into a string in JavaScript






30. Command to display a prompt






31. To get the current value for textboxes






32. To declare a variable in JavaScript






33. To test that a variable contains a valid number






34. To get the value or the currently selected item for lists






35. 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






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






37. String object method used to return a new string that contains part of the original string from the specified start position






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






39. The string escape sequence to insert a form feed in JavaScript






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






41. The string escape sequence to insert a single quote in JavaScript


42. To assign a default value to a prompt






43. To set the current checked status of the control for checkboxes






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






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






46. To create an Array object in JavaScript






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






48. The identity operator for equals






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






50. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control