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. Number object method used to return a string with a given number base
toString(base)
document.getElementById(id)
setMilliseconds()
focus
2. The string escape sequence to insert a double quote in JavaScript
"
setMilliseconds()
toTimeString()
var answerVar = confirm("Message Text Here")
3. To access the text element in a <span> tag
var functionName = function(param1, param2, paramN) {}
document.getElementById("spanId").firstChild;
isNaN(varHere) //Returns true or false.
toUpperCase()
4. Number object method used to round numbers to the specified number of decimal places
Math.min(var1, var2, varN)
toFixed(digits)
"
window.onload = function() {//actions here}
5. When you add a string and a number the result will be a ____
document.writeln("Text Here") //Advances to new line after text
string
Math.sqrt(number)
document.getElementById("spanId").firstChild.nodeValue = "New Value";
6. To get the text value of the control for radio buttons
event handler .
f
document.getElementById("checkboxId").value;
var answerVar = confirm("Message Text Here")
7. Math object method used to return a given number that has been rounded to the closes integer value
Math.round(number)
toLowerCase()
getTime()
Underscores
8. Math object method used to return a random number
document.getElementById("listId").value;
isNaN(varHere) //Returns true or false.
document.getElementById(id)
Math.random() //Returns a value >= 0.0 but <1.0
9. To create a Date object in JavaScript
confirm()
getTime()
var dateVar = new Date()
global
10. To get the current checked status of the control for radio buttons
var answerVar = confirm("Message Text Here")
document.getElementById("CheckboxId").checked = true; //Could also be false
document.getElementById("radioButtonId").checked;
Math.random() //Returns a value >= 0.0 but <1.0
11. To get the current checked status of the control for checkboxes
'
document.getElementById("checkboxId").checked;
semicolon ";"
toString(base)
12. To test that a variable contains a valid number
t
toString()
isNaN(varHere) //Returns true or false.
\
13. To create a new Date object
(Condition_Expression) ? Value_If_True : Value_If_False;
n
charAt(position)
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
14. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
string
f
ondblclick
event handler .
15. A statement that yields a value
expression
document.getElementById("TextBoxId").disabled = true;
'
toString()
16. To get the current value for textboxes
Src - e.g. <script src="fileName.js"> //
toLowerCase()
Use the second parameter. Example: prompt("Enter Age:", "18")
document.getElementById("TextBoxId").value;
17. To set the control to be disabled for textboxes
ondblclick
Math.ceil(number)
document.getElementById("TextBoxId").disabled = true;
Src - e.g. <script src="fileName.js"> //
18. When you __________ a javascript variable it retains its original value
toString()
redeclare
document.getElementById("radioButtonId").checked;
focus
19. ________ comments start with / and end with /.
Multi line
toString()
var dateObject = new Date("11/22/2012 18:25:35")
document.getElementById("ButtonId").onclick = functionName;
20. To denote a string in JavaScript
<noscript>
Either single or double quotes surrounding the data
window.location()
Use the second parameter. Example: prompt("Enter Age:", "18")
21. To code a while statement in JavaScript
while (condition) {}
Use the second parameter. Example: prompt("Enter Age:", "18")
window.location()
Multi line
22. Math object method used to return the square root of a given number
document.getElementById("CheckboxId").checked = true; //Could also be false
document.getElementById("radioButtonId").checked = true; //Could also be false
Math.sqrt(number)
var answerVar = confirm("Message Text Here")
23. The identity operator for equals
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
focus
toString(base)
===
24. To get the current value of the control for a text area
document.getElementById("textAreaId").value;
Either single or double quotes surrounding the data
charAt(position)
var variableName;
25. To assign the return value of confirm() to a variable
Math.abs(number)
var answerVar = confirm("Message Text Here")
var stringVar = prompt("Text Here")
var functionName = function(param1, param2, paramN) {}
26. What String object method returns a new string containing the value of the original string but in all lower case
substring(startIndex, stopIndex)
t
toLowerCase()
var variableName;
27. What Date object method is used to return the number of milliseconds since the start of GMT
ondblclick
standard equality operators
document.getElementById("spanId").firstChild.nodeValue = "New Value";
getTime()
28. To set the digit precision of a decimal number
setMilliseconds()
Math.floor(number)
var arrayVar = new Array()
toFixed(digitCount)
29. This returns only True or false values
confirm()
global
ondblclick
document.getElementById("textAreaId").value = "Text Value";
30. To declare a variable in JavaScript
var variableName;
document.getElementById(id)
Two forward slashes "//"
document.getElementById("textAreaId").value;
31. To display an alert
'
var variableName;
alert("Alert Text Here")
Math.pow(number, power)
32. Math object method used to return the absolute value of a given number
document.write("Text Here") //Remains on current line
Math.abs(number)
Charset
concat(var1, var2, varN)
33. To get the value or the currently selected item for lists
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
t
document.getElementById("listId").value;
Math.min(var1, var2, varN)
34. Command to display a prompt
prompt("Text Here")
document.getElementById("checkboxId").value;
t
var dateObject = new Date("11/22/2012 18:25:35")
35. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
document.getElementById("radioButtonId").checked;
focus
document.write("Text Here") //Remains on current line
for (counter; condition; incrementor) {}
36. 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
Math.round(number)
substring(startIndex, stopIndex)
document.getElementById("CheckboxId").checked = true; //Could also be false
for (counter; condition; incrementor) {}
37. To set the current value of the control for a text area
document.getElementById("radioButtonId").value;
document.getElementById("ButtonId").onclick = functionName;
document.getElementById("textAreaId").value = "Text Value";
document.getElementById("checkboxId").checked;
38. Math object method used to return a given number rounded to the next lowest integer value
Number.NEGATIVE_INFINITY
'
Math.floor(number)
var arrayVar = new Array()
39. The string escape sequence to insert a vertical tab in JavaScript
toExponential(digits)
Use the second parameter. Example: prompt("Enter Age:", "18")
v
substring(startIndex, stopIndex)
40. To create a function that returns a value in JavaScript
document.getElementById("listId").value;
focus
var functionName = function(param1, param2, paramN) {}
document.getElementById("textAreaId").value;
41. To assign actions to the window onLoad event
document.getElementById(id)
toUpperCase()
document.getElementById("TextBoxId").focus;
window.onload = function() {//actions here}
42. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
var variableName;
Two forward slashes "//"
document.getElementById("TextBoxId").disabled = true;
Number.NEGATIVE_INFINITY
43. To write text to the current element of the DOM
alert("Alert Text Here")
Either single or double quotes surrounding the data
document.write("Text Here") //Remains on current line
var variableName;
44. The _____ attribute is used to denote external file for script use
semicolon ";"
Src - e.g. <script src="fileName.js"> //
document.getElementById("spanId").firstChild.nodeValue = "New Value";
document.getElementById("textAreaId").value;
45. String object method used to return a new string that contains part of the original string from the specified start position
redeclare
substring(startIndex)
for (counter; condition; incrementor) {}
toUpperCase()
46. Number object method used to return a numerical string with the specified number of significant digits
toString()
toPrecision(precision)
redeclare
Either single or double quotes surrounding the data
47. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
Math.max(var1, var2, varN)
if (condition) {}
Underscores
v
48. To set the current checked status of the control for checkboxes
document.getElementById("CheckboxId").checked = true; //Could also be false
document.getElementById(id)
toFixed(digitCount)
window.location = "New Web Address Here";
49. To access a page element by id
t
Multi line
isNaN(varHere) //Returns true or false.
document.getElementById(id)
50. The escape sequence used to insert a Unicode character into a string in JavaScript
var dateVar = new Date()
var stringVar = "part 1:" + "part 2";
ondblclick
udddd