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. This returns only True or false values
for (counter; condition; incrementor) {}
toString(base)
<script type="text/javascript">.....</script>
confirm()
2. Math object method used to return the square root of a given number
charAt(position)
document.getElementById("ButtonId").onclick = functionName;
Underscores
Math.sqrt(number)
3. The escape sequence used to insert a Unicode character into a string in JavaScript
confirm()
udddd
document.getElementById("checkboxId").checked;
var dateVar = new Date()
4. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
<noscript>
document.write("Text Here") //Remains on current line
alert("Alert Text Here")
toFixed(digits)
5. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
concat(var1, var2, varN)
Objects
document.write("Text Here") //Remains on current line
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
6. The string escape sequence to insert a backslash in JavaScript
Math.sqrt(number)
\
document.write("Text Here") //Remains on current line
toFixed(digits)
7. To test that a variable contains a valid number
isNaN(varHere) //Returns true or false.
global
document.getElementById("radioButtonId").checked;
n
8. Number object method used to round numbers to the specified number of decimal places
n
isNaN(varHere) //Returns true or false.
toFixed(digits)
'
9. The format to create a new Date object from a string
toFixed(digitCount)
document.getElementById("checkboxId").value;
for (counter; condition; incrementor) {}
var dateObject = new Date("11/22/2012 18:25:35")
10. What String object method returns a new string containing the value of the original string but in all lower case
toLowerCase()
var dateObject = new Date("11/22/2012 18:25:35")
var functionName = function(param1, param2, paramN) {}
while (condition) {}
11. To set the current value of the control for a text area
n
toTimeString()
document.getElementById("textAreaId").value = "Text Value";
Objects
12. What String object method returns a new string containing the value of the original string but in all upper case
n
for (counter; condition; incrementor) {}
toUpperCase()
document.getElementById("ButtonId").onclick = functionName;
13. To write a line to the current element of the DOM (Document Object Model)
setMilliseconds()
var stringVar = "part 1:" + "part 2";
Math.floor(number)
document.writeln("Text Here") //Advances to new line after text
14. String object method used to concatenate multiple strings
concat(var1, var2, varN)
getFullYear()
var answerVar = confirm("Message Text Here")
setMilliseconds()
15. To insert Javascript into a web page
<script type="text/javascript">.....</script>
Multi line
f
event handler .
16. To get the current value for textboxes
document.getElementById("TextBoxId").value;
var arrayVar = new Array()
getFullYear()
alert("Alert Text Here")
17. What Date object method is used to return the number of milliseconds since the start of GMT
Math.abs(number)
getTime()
document.getElementById("listId").value;
toDateString()
18. The string escape sequence to start a new line in JavaScript
var dateObject = new Date("11/22/2012 18:25:35")
n
document.getElementById("CheckboxId").checked = true; //Could also be false
charAt(position)
19. To assign actions to the window onLoad event
window.onload = function() {//actions here}
document.getElementById("CheckboxId").checked = true; //Could also be false
document.getElementById("ButtonId").onclick = functionName;
charAt(position)
20. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
document.getElementById("TextBoxId").disabled = true;
document.getElementById("radioButtonId").checked;
var arrayVar = new Array()
focus
21. To set the control to be disabled for textboxes
document.getElementById("TextBoxId").disabled = true;
Underscores
Math.sqrt(number)
Math.max(var1, var2, varN)
22. To assign the return value of confirm() to a variable
focus
while (condition) {}
var answerVar = confirm("Message Text Here")
Math.abs(number)
23. ________ comments start with / and end with /.
Either single or double quotes surrounding the data
Multi line
Math.max(var1, var2, varN)
setMilliseconds()
24. To create a new Date object
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
if (condition) {}
toFixed(digits)
semicolon ";"
25. To write text to the current element of the DOM
document.write("Text Here") //Remains on current line
confirm("Message Text Here")
toTimeString()
indexOf(searchValue, startPosition)
26. To assign the value from a prompt to a non-string variable
document.getElementById("spanId").firstChild;
isNaN(varHere) //Returns true or false.
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
var variableName;
27. Number object method used to return a number in exponential format with the specified number of decimal places
toExponential(digits)
<noscript>
t
var stringVar = prompt("Text Here")
28. To get the value or the currently selected item for lists
for (counter; condition; incrementor) {}
document.getElementById("listId").value;
Underscores
n
29. The identity operator for equals
toExponential(digits)
===
(Condition_Expression) ? Value_If_True : Value_If_False;
concat(var1, var2, varN)
30. 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.max(var1, var2, varN)
document.getElementById("TextBoxId").value;
Math.sqrt(number)
substring(startIndex, stopIndex)
31. Math object method used to return the lowest value for a set of supplied numbers
var stringVar = prompt("Text Here")
Math.min(var1, var2, varN)
f
document.getElementById("radioButtonId").checked = true; //Could also be false
32. To get the current checked status of the control for checkboxes
\
document.getElementById("checkboxId").checked;
Charset
document.getElementById("CheckboxId").checked = true; //Could also be false
33. The string escape sequence to insert a tab in JavaScript
document.getElementById("spanId").firstChild;
t
document.getElementById("TextBoxId").value;
var answerVar = confirm("Message Text Here")
34. The string escape sequence to insert a vertical tab in JavaScript
v
var stringVar = prompt("Text Here")
toPrecision(precision)
while (condition) {}
35. The string escape sequence to insert a form feed in JavaScript
f
prompt("Text Here")
semicolon ";"
indexOf(searchValue, startPosition)
36. Command to display a prompt
document.getElementById("listId").value;
t
prompt("Text Here")
var functionName = function(param1, param2, paramN) {}
37. The _____ attribute is used to denote external file for script use
===
document.getElementById("TextBoxId").focus;
toLowerCase()
Src - e.g. <script src="fileName.js"> //
38. To get the text value of the control for radio buttons
ondblclick
document.getElementById("checkboxId").value;
document.getElementById("radioButtonId").value;
concat(var1, var2, varN)
39. Math object method used to return the absolute value of a given number
toFixed(digits)
while (condition) {}
document.getElementById("textAreaId").value = "Text Value";
Math.abs(number)
40. To denote a string in JavaScript
Either single or double quotes surrounding the data
Multi line
document.writeln("Text Here") //Advances to new line after text
document.getElementById("TextBoxId").focus;
41. When you __________ a javascript variable it retains its original value
redeclare
alert("Alert Text Here")
toDateString()
Math.sqrt(number)
42. To set focus on the control for textboxes
alert("Alert Text Here")
document.getElementById("TextBoxId").focus;
!==
var functionName = function(param1, param2, paramN) {}
43. To get the current value of the control for a text area
'
toLowerCase()
document.getElementById("textAreaId").value;
window.onload = function() {//actions here}
44. To view the current web address using JavaScript
window.location()
event handler .
document.getElementById("textAreaId").value;
setMilliseconds()
45. To get the text value of the control for radio buttons
document.getElementById("textAreaId").value = "Text Value";
redeclare
document.getElementById("checkboxId").value;
t
46. To code an If statement in JavaScript
document.getElementById("radioButtonId").checked = true; //Could also be false
indexOf(searchValue, startPosition)
if (condition) {}
===
47. JavaScript is case _______
window.onload = function() {//actions here}
var variableName;
sensitive
Math.random() //Returns a value >= 0.0 but <1.0
48. Math object method used to return the highest value from a set of supplied numbers
alert("Alert Text Here")
Math.max(var1, var2, varN)
concat(var1, var2, varN)
Math.sqrt(number)
49. Math object method used to return a given number rounded to the next highest integer value
getFullYear()
f
Math.ceil(number)
document.getElementById("checkboxId").value;
50. The string escape sequence to insert a carriage return in JavaScript
'
r
toUpperCase()
document.getElementById("CheckboxId").checked = true; //Could also be false