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