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. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
toDateString()
Underscores
while (condition) {}
window.onload = function() {//actions here}
2. String object method used to get the character at a specified index position
charAt(position)
toTimeString()
for (counter; condition; incrementor) {}
while (condition) {}
3. To code a for statement in JavaScript
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
for (counter; condition; incrementor) {}
Two forward slashes "//"
document.getElementById("listId").value;
4. To get the text value of the control for radio buttons
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
document.getElementById("CheckboxId").checked = true; //Could also be false
document.getElementById("checkboxId").value;
getFullYear()
5. To declare a variable in JavaScript
for (counter; condition; incrementor) {}
Src - e.g. <script src="fileName.js"> //
var variableName;
Math.min(var1, var2, varN)
6. The string escape sequence to insert a vertical tab in JavaScript
document.getElementById("textAreaId").value;
<noscript>
toString()
v
7. To denote a string in JavaScript
f
Either single or double quotes surrounding the data
toTimeString()
indexOf(searchValue, startPosition)
8. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
v
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Number.NEGATIVE_INFINITY
t
9. To access the text element in a <span> tag
var functionName = function(param1, param2, paramN) {}
<script type="text/javascript">.....</script>
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
document.getElementById("spanId").firstChild;
10. The identity operator for not equal
v
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Math.pow(number, power)
!==
11. To make the browser load a new page using JavaScript
window.location = "New Web Address Here";
document.getElementById("TextBoxId").value;
substring(startIndex, stopIndex)
toFixed(digits)
12. String object method used to concatenate multiple strings
Math.ceil(number)
concat(var1, var2, varN)
window.onload = function() {//actions here}
toString(base)
13. The identity operator for equals
document.getElementById("checkboxId").value;
===
Math.pow(number, power)
var dateVar = new Date()
14. Math object method used to return a given number that has been rounded to the closes integer value
var stringVar = prompt("Text Here")
!==
Math.round(number)
var arrayVar = new Array()
15. 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
document.getElementById("radioButtonId").value;
substring(startIndex, stopIndex)
Math.sqrt(number)
focus
16. Math object method used to return the absolute value of a given number
toUpperCase()
Math.abs(number)
"
toFixed(digitCount)
17. Date object method used to return a string containing the time
document.write("Text Here") //Remains on current line
document.getElementById("TextBoxId").focus;
v
toTimeString()
18. To insert Javascript into a web page
ondblclick
prompt("Text Here")
<script type="text/javascript">.....</script>
semicolon ";"
19. To create an Array object in JavaScript
Use the second parameter. Example: prompt("Enter Age:", "18")
var arrayVar = new Array()
document.getElementById("spanId").firstChild.nodeValue = "New Value";
!==
20. The four attributes of the <script> tag:Type - Src - _____ and Defer
Charset
document.getElementById("radioButtonId").checked = true; //Could also be false
v
toDateString()
21. The string escape sequence to insert a double quote in JavaScript
while (condition) {}
"
Math.random() //Returns a value >= 0.0 but <1.0
toLowerCase()
22. To assign a default value to a prompt
Number.NEGATIVE_INFINITY
var stringVar = "part 1:" + "part 2";
Use the second parameter. Example: prompt("Enter Age:", "18")
toFixed(digits)
23. A _______ variable can be changed and accessed from within and without a function or object.
f
getTime()
for (counter; condition; incrementor) {}
global
24. A statement that yields a value
<noscript>
Math.min(var1, var2, varN)
Use the second parameter. Example: prompt("Enter Age:", "18")
expression
25. Date object method used to return a string containing the date and time
Underscores
toString()
Math.round(number)
"
26. Math object method used to return a given number rounded to the next highest integer value
getTime()
Math.ceil(number)
toDateString()
toString()
27. To display an alert
alert("Alert Text Here")
document.getElementById("TextBoxId").disabled = true;
sensitive
indexOf(searchValue, startPosition)
28. To create a new Date object
f
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
sensitive
document.getElementById("checkboxId").value;
29. To get the current value of the control for a text area
document.getElementById("textAreaId").value;
document.write("Text Here") //Remains on current line
document.getElementById(id)
Number.NEGATIVE_INFINITY
30. The format to create a new Date object from a string
for (counter; condition; incrementor) {}
var dateObject = new Date("11/22/2012 18:25:35")
redeclare
document.getElementById(id)
31. Command to display a prompt
prompt("Text Here")
n
document.getElementById("radioButtonId").checked;
Use the second parameter. Example: prompt("Enter Age:", "18")
32. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
var functionName = function(param1, param2, paramN) {}
<noscript>
toDateString()
if (condition) {}
33. To view the current web address using JavaScript
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
f
var variableName;
window.location()
34. To set the current checked status of the control for radio buttons
f
document.getElementById("radioButtonId").checked = true; //Could also be false
Math.ceil(number)
<script type="text/javascript">.....</script>
35. String object method used to return a new string that contains part of the original string from the specified start position
document.write("Text Here") //Remains on current line
document.getElementById("radioButtonId").checked = true; //Could also be false
substring(startIndex)
Math.random() //Returns a value >= 0.0 but <1.0
36. The string escape sequence to insert a form feed in JavaScript
f
Multi line
Use the second parameter. Example: prompt("Enter Age:", "18")
<noscript>
37. Number object method used to return a numerical string with the specified number of significant digits
!==
while (condition) {}
toPrecision(precision)
\
38. To code a while statement in JavaScript
"
while (condition) {}
event handler .
Use the second parameter. Example: prompt("Enter Age:", "18")
39. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
Math.max(var1, var2, varN)
ondblclick
getFullYear()
Math.random() //Returns a value >= 0.0 but <1.0
40. The _____ attribute is used to denote external file for script use
semicolon ";"
toTimeString()
Src - e.g. <script src="fileName.js"> //
window.location()
41. Number object method used to return a number in exponential format with the specified number of decimal places
document.getElementById("TextBoxId").value;
toExponential(digits)
substring(startIndex, stopIndex)
toPrecision(precision)
42. To get the text value of the control for radio buttons
global
var stringVar = prompt("Text Here")
document.getElementById("radioButtonId").value;
var answerVar = confirm("Message Text Here")
43. Math object method used to return the square root of a given number
document.writeln("Text Here") //Advances to new line after text
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
document.getElementById("TextBoxId").disabled = true;
Math.sqrt(number)
44. To get the current checked status of the control for radio buttons
semicolon ";"
expression
window.onload = function() {//actions here}
document.getElementById("radioButtonId").checked;
45. The string escape sequence to start a new line in JavaScript
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
n
var functionName = function(param1, param2, paramN) {}
var dateVar = new Date()
46. What Date object method is used to return the number of milliseconds since the start of GMT
document.getElementById("CheckboxId").checked = true; //Could also be false
var answerVar = confirm("Message Text Here")
getTime()
Math.abs(number)
47. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________
var arrayVar = new Array()
setMilliseconds()
v
var variableName;
48. To access a page element by id
document.writeln("Text Here") //Advances to new line after text
Charset
document.getElementById("checkboxId").value;
document.getElementById(id)
49. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
confirm("Message Text Here")
Objects
semicolon ";"
Math.random() //Returns a value >= 0.0 but <1.0
50. Math object method used to return the highest value from a set of supplied numbers
document.getElementById(id)
Math.max(var1, var2, varN)
string
semicolon ";"