SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
|
Email
Search
Test your basic knowledge |
Javascript Basics
Start Test
Study First
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 create a single line comment in JavaScript
toDateString()
for (counter; condition; incrementor) {}
document.getElementById("radioButtonId").value;
Two forward slashes "//"
2. The string escape sequence to insert a backslash in JavaScript
'
\
document.getElementById("radioButtonId").value;
toFixed(digits)
3. The string escape sequence to start a new line in JavaScript
'
!==
semicolon ";"
n
4. To get the current value for textboxes
charAt(position)
window.location = "New Web Address Here";
semicolon ";"
document.getElementById("TextBoxId").value;
5. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
'
event handler .
getFullYear()
Objects
6. To set focus on the control for textboxes
string
document.getElementById("radioButtonId").value;
document.getElementById("TextBoxId").focus;
f
7. To create a function in JavaScript
var functionName = function(param1, param2, paramN) {}
window.location = "New Web Address Here";
document.getElementById("TextBoxId").disabled = true;
getFullYear()
8. This returns only True or false values
toFixed(digitCount)
Math.ceil(number)
confirm()
Math.max(var1, var2, varN)
9. Math object method used to return the square root of a given number
toFixed(digitCount)
Math.sqrt(number)
"
document.getElementById("radioButtonId").value;
10. To create an Array object in JavaScript
toUpperCase()
var arrayVar = new Array()
document.getElementById("spanId").firstChild.nodeValue = "New Value";
while (condition) {}
11. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
Number.NEGATIVE_INFINITY
for (counter; condition; incrementor) {}
expression
"
12. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
document.write("Text Here") //Remains on current line
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
event handler .
document.getElementById("TextBoxId").disabled = true;
13. To code a button.onclick event handler
redeclare
document.getElementById("ButtonId").onclick = functionName;
Either single or double quotes surrounding the data
toUpperCase()
14. To get the text value of the control for radio buttons
ondblclick
toFixed(digits)
document.getElementById("checkboxId").value;
charAt(position)
15. Number object method used to round numbers to the specified number of decimal places
toFixed(digits)
Multi line
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
toExponential(digits)
16. To assign the return value of confirm() to a variable
Math.pow(number, power)
var answerVar = confirm("Message Text Here")
focus
===
17. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
\
confirm("Message Text Here")
event handler .
focus
18. The string escape sequence to insert a vertical tab in JavaScript
f
var arrayVar = new Array()
v
Either single or double quotes surrounding the data
19. To get the current checked status of the control for radio buttons
document.getElementById("radioButtonId").checked;
toString(base)
toTimeString()
alert("Alert Text Here")
20. To assign actions to the window onLoad event
window.onload = function() {//actions here}
redeclare
!==
Math.min(var1, var2, varN)
21. To get the current checked status of the control for checkboxes
Underscores
document.writeln("Text Here") //Advances to new line after text
toLowerCase()
document.getElementById("checkboxId").checked;
22. What Date object method is used to return the number of milliseconds since the start of GMT
toLowerCase()
getTime()
document.getElementById("checkboxId").value;
"
23. The format to create a new Date object from a string
var dateObject = new Date("11/22/2012 18:25:35")
Src - e.g. <script src="fileName.js"> //
confirm()
document.getElementById("checkboxId").value;
24. Math object method used to return the lowest value for a set of supplied numbers
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Charset
Use the second parameter. Example: prompt("Enter Age:", "18")
Math.min(var1, var2, varN)
25. The string escape sequence to insert a tab in JavaScript
document.getElementById("spanId").firstChild.nodeValue = "New Value";
string
var variableName;
t
26. To write a line to the current element of the DOM (Document Object Model)
document.getElementById("radioButtonId").checked = true; //Could also be false
toString(base)
Math.sqrt(number)
document.writeln("Text Here") //Advances to new line after text
27. To test that a variable contains a valid number
n
Math.pow(number, power)
var variableName;
isNaN(varHere) //Returns true or false.
28. To set the digit precision of a decimal number
toFixed(digitCount)
alert("Alert Text Here")
Objects
toUpperCase()
29. To get the text value of the control for radio buttons
toString()
toUpperCase()
document.getElementById("radioButtonId").value;
standard equality operators
30. To concatenate multiple parts into a string
semicolon ";"
document.writeln("Text Here") //Advances to new line after text
if (condition) {}
var stringVar = "part 1:" + "part 2";
31. What String object method returns a new string containing the value of the original string but in all lower case
toLowerCase()
Objects
window.location = "New Web Address Here";
charAt(position)
32. String object method used to return the position of the first instance of a specified search string starting from the specified index
window.onload = function() {//actions here}
indexOf(searchValue, startPosition)
n
document.getElementById("textAreaId").value;
33. The events common to most controls: onfocus - onblur - onclick - _______ - onchange - onselect
Src - e.g. <script src="fileName.js"> //
ondblclick
var variableName;
document.getElementById("CheckboxId").checked = true; //Could also be false
34. To display a confirmation
toExponential(digits)
indexOf(searchValue, startPosition)
confirm("Message Text Here")
toString()
35. To set the current checked status of the control for radio buttons
toUpperCase()
expression
var variableName;
document.getElementById("radioButtonId").checked = true; //Could also be false
36. To assign the value from a prompt to a non-string variable
while (condition) {}
if (condition) {}
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Number.NEGATIVE_INFINITY
37. The string escape sequence to insert a double quote in JavaScript
"
n
Two forward slashes "//"
Math.random() //Returns a value >= 0.0 but <1.0
38. To make the browser load a new page using JavaScript
Use the second parameter. Example: prompt("Enter Age:", "18")
window.location = "New Web Address Here";
Math.ceil(number)
r
39. String object method used to concatenate multiple strings
document.getElementById("radioButtonId").checked = true; //Could also be false
concat(var1, var2, varN)
document.getElementById("radioButtonId").checked;
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
40. The string escape sequence to insert a single quote in JavaScript
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
41. To assign the value from a prompt to a string
sensitive
for (counter; condition; incrementor) {}
var stringVar = prompt("Text Here")
if (condition) {}
42. To code a for statement in JavaScript
for (counter; condition; incrementor) {}
f
!==
Math.floor(number)
43. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
getFullYear()
Math.ceil(number)
\
prompt("Text Here")
44. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
Underscores
window.onload = function() {//actions here}
substring(startIndex)
expression
45. To create a function that returns a value in JavaScript
Math.max(var1, var2, varN)
setMilliseconds()
document.getElementById("CheckboxId").checked = true; //Could also be false
var functionName = function(param1, param2, paramN) {}
46. To access the text element in a <span> tag
document.getElementById("TextBoxId").disabled = true;
prompt("Text Here")
Use the second parameter. Example: prompt("Enter Age:", "18")
document.getElementById("spanId").firstChild;
47. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
<noscript>
global
document.getElementById("radioButtonId").checked = true; //Could also be false
document.getElementById("TextBoxId").value;
48. To create a Date object in JavaScript
document.write("Text Here") //Remains on current line
n
document.getElementById("ButtonId").onclick = functionName;
var dateVar = new Date()
49. Math object method used to return the absolute value of a given number
if (condition) {}
Math.abs(number)
toString(base)
getTime()
50. To assign a default value to a prompt
Use the second parameter. Example: prompt("Enter Age:", "18")
document.getElementById(id)
ondblclick
Two forward slashes "//"