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. Math object method used to return the absolute value of a given number
toUpperCase()
var arrayVar = new Array()
document.getElementById("checkboxId").checked;
Math.abs(number)
2. The four attributes of the <script> tag:Type - Src - _____ and Defer
document.getElementById("spanId").firstChild;
Objects
sensitive
Charset
3. Date object method used to return a string containing the time
toTimeString()
var stringVar = prompt("Text Here")
substring(startIndex)
Underscores
4. When you __________ a javascript variable it retains its original value
setMilliseconds()
var stringVar = "part 1:" + "part 2";
toUpperCase()
redeclare
5. To display a confirmation
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
toString()
document.getElementById("CheckboxId").checked = true; //Could also be false
confirm("Message Text Here")
6. To set focus on the control for textboxes
redeclare
document.getElementById("TextBoxId").focus;
confirm()
charAt(position)
7. To get the current value of the control for a text area
ondblclick
document.getElementById("textAreaId").value;
Multi line
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
8. The identity operator for not equal
global
f
!==
"
9. 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
v
substring(startIndex, stopIndex)
ondblclick
var dateObject = new Date("11/22/2012 18:25:35")
10. Math object method used to return the highest value from a set of supplied numbers
document.getElementById("radioButtonId").value;
Math.max(var1, var2, varN)
document.getElementById("TextBoxId").value;
var variableName;
11. Number object method used to return a numerical string with the specified number of significant digits
window.location = "New Web Address Here";
toPrecision(precision)
Number.NEGATIVE_INFINITY
var answerVar = confirm("Message Text Here")
12. To set the control to be disabled for textboxes
document.getElementById("radioButtonId").value;
global
document.getElementById("CheckboxId").checked = true; //Could also be false
document.getElementById("TextBoxId").disabled = true;
13. To create a new Date object
Either single or double quotes surrounding the data
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
window.onload = function() {//actions here}
setMilliseconds()
14. To test that a variable contains a valid number
semicolon ";"
document.getElementById("TextBoxId").value;
document.getElementById(id)
isNaN(varHere) //Returns true or false.
15. The string escape sequence to insert a vertical tab in JavaScript
v
===
charAt(position)
while (condition) {}
16. To alter the value of the text element in a span tag
document.getElementById("spanId").firstChild;
document.getElementById(id)
\
document.getElementById("spanId").firstChild.nodeValue = "New Value";
17. What String object method returns a new string containing the value of the original string but in all lower case
\
while (condition) {}
toLowerCase()
var stringVar = prompt("Text Here")
18. A statement that yields a value
document.getElementById("checkboxId").value;
document.getElementById("textAreaId").value;
===
expression
19. To set the current checked status of the control for radio buttons
while (condition) {}
udddd
alert("Alert Text Here")
document.getElementById("radioButtonId").checked = true; //Could also be false
20. To create a Date object in JavaScript
charAt(position)
var dateVar = new Date()
string
Math.min(var1, var2, varN)
21. What String object method returns a new string containing the value of the original string but in all upper case
standard equality operators
toUpperCase()
toLowerCase()
window.location()
22. To display an alert
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
alert("Alert Text Here")
document.getElementById("TextBoxId").disabled = true;
var dateObject = new Date("11/22/2012 18:25:35")
23. Math object method used to return a given number rounded to the next highest integer value
document.getElementById("checkboxId").checked;
window.location = "New Web Address Here";
Math.ceil(number)
document.getElementById("radioButtonId").checked;
24. To assign the return value of confirm() to a variable
document.writeln("Text Here") //Advances to new line after text
var answerVar = confirm("Message Text Here")
redeclare
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
25. The string escape sequence to insert a tab in JavaScript
document.getElementById("ButtonId").onclick = functionName;
t
redeclare
toDateString()
26. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________
Charset
'
toDateString()
setMilliseconds()
27. The _____ attribute is used to denote external file for script use
var dateObject = new Date("11/22/2012 18:25:35")
ondblclick
Src - e.g. <script src="fileName.js"> //
<script type="text/javascript">.....</script>
28. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
window.location = "New Web Address Here";
document.getElementById("spanId").firstChild;
Underscores
Number.NEGATIVE_INFINITY
29. The string escape sequence to insert a form feed in JavaScript
toExponential(digits)
f
document.getElementById("listId").value;
v
30. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
var stringVar = prompt("Text Here")
toPrecision(precision)
window.location()
<noscript>
31. String object method used to get the character at a specified index position
charAt(position)
'
substring(startIndex)
"
32. Date object method used to return a string containing the date
getFullYear()
toDateString()
document.getElementById("radioButtonId").checked;
toTimeString()
33. The format to create a new Date object from a string
var dateObject = new Date("11/22/2012 18:25:35")
redeclare
document.getElementById(id)
===
34. The syntax of a conditional operator
sensitive
(Condition_Expression) ? Value_If_True : Value_If_False;
var dateVar = new Date()
confirm()
35. To create an Array object in JavaScript
string
Math.min(var1, var2, varN)
var arrayVar = new Array()
getTime()
36. To assign the value from a prompt to a non-string variable
document.getElementById("ButtonId").onclick = functionName;
toFixed(digitCount)
Math.ceil(number)
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
37. To get the text value of the control for radio buttons
document.getElementById("checkboxId").value;
Math.pow(number, power)
expression
Objects
38. Number object method used to return a string with a given number base
getFullYear()
toString(base)
expression
isNaN(varHere) //Returns true or false.
39. Unlike ________________ identity operators do not perform type coercion.
var answerVar = confirm("Message Text Here")
document.getElementById("spanId").firstChild.nodeValue = "New Value";
standard equality operators
"
40. To denote a string in JavaScript
if (condition) {}
Either single or double quotes surrounding the data
document.getElementById("TextBoxId").value;
toUpperCase()
41. The string escape sequence to insert a carriage return in JavaScript
confirm()
toExponential(digits)
concat(var1, var2, varN)
r
42. Number object method used to round numbers to the specified number of decimal places
Either single or double quotes surrounding the data
!==
<script type="text/javascript">.....</script>
toFixed(digits)
43. Number object method used to return a number in exponential format with the specified number of decimal places
toExponential(digits)
document.getElementById(id)
toFixed(digits)
document.getElementById("textAreaId").value = "Text Value";
44. To write text to the current element of the DOM
Either single or double quotes surrounding the data
isNaN(varHere) //Returns true or false.
document.write("Text Here") //Remains on current line
indexOf(searchValue, startPosition)
45. Math object method used to return a given number that has been rounded to the closes integer value
Math.round(number)
Use the second parameter. Example: prompt("Enter Age:", "18")
focus
indexOf(searchValue, startPosition)
46. To assign the value from a prompt to a string
Math.ceil(number)
toFixed(digitCount)
expression
var stringVar = prompt("Text Here")
47. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
window.location()
document.getElementById("CheckboxId").checked = true; //Could also be false
var functionName = function(param1, param2, paramN) {}
Underscores
48. To code a while statement in JavaScript
document.getElementById("textAreaId").value = "Text Value";
while (condition) {}
document.getElementById("checkboxId").checked;
<script type="text/javascript">.....</script>
49. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
r
Objects
substring(startIndex)
var stringVar = "part 1:" + "part 2";
50. The string escape sequence to insert a backslash in JavaScript
<noscript>
confirm()
Math.round(number)
\