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 a given number rounded to the next lowest integer value
document.getElementById("CheckboxId").checked = true; //Could also be false
Math.max(var1, var2, varN)
toString()
Math.floor(number)
2. Math object method used to return the absolute value of a given number
document.getElementById("spanId").firstChild;
document.getElementById("CheckboxId").checked = true; //Could also be false
udddd
Math.abs(number)
3. The identity operator for equals
<script type="text/javascript">.....</script>
toFixed(digitCount)
var arrayVar = new Array()
===
4. To create an Array object in JavaScript
n
Math.abs(number)
var arrayVar = new Array()
Math.random() //Returns a value >= 0.0 but <1.0
5. The format to create a new Date object from a string
getTime()
window.onload = function() {//actions here}
document.getElementById("radioButtonId").checked;
var dateObject = new Date("11/22/2012 18:25:35")
6. JavaScript is case _______
sensitive
Two forward slashes "//"
toFixed(digitCount)
Src - e.g. <script src="fileName.js"> //
7. The string escape sequence to insert a double quote in JavaScript
var stringVar = prompt("Text Here")
window.location()
Number.NEGATIVE_INFINITY
"
8. To set the current checked status of the control for radio buttons
document.write("Text Here") //Remains on current line
===
toFixed(digits)
document.getElementById("radioButtonId").checked = true; //Could also be false
9. To create a function that returns a value in JavaScript
Either single or double quotes surrounding the data
var functionName = function(param1, param2, paramN) {}
Math.max(var1, var2, varN)
Multi line
10. Date object method used to return a string containing the date
Two forward slashes "//"
toDateString()
var functionName = function(param1, param2, paramN) {}
toString(base)
11. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
document.getElementById("spanId").firstChild.nodeValue = "New Value";
Objects
Math.sqrt(number)
Use the second parameter. Example: prompt("Enter Age:", "18")
12. Math object method used to return a random number
toPrecision(precision)
Charset
toExponential(digits)
Math.random() //Returns a value >= 0.0 but <1.0
13. What String object method returns a new string containing the value of the original string but in all lower case
redeclare
semicolon ";"
toLowerCase()
document.getElementById("spanId").firstChild.nodeValue = "New Value";
14. To assign the return value of confirm() to a variable
Math.min(var1, var2, varN)
while (condition) {}
var answerVar = confirm("Message Text Here")
toPrecision(precision)
15. To access a page element by id
Underscores
var answerVar = confirm("Message Text Here")
document.getElementById(id)
getFullYear()
16. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________
standard equality operators
document.getElementById("spanId").firstChild;
toDateString()
setMilliseconds()
17. This returns only True or false values
confirm()
global
\
toExponential(digits)
18. To get the current value of the control for a text area
t
var stringVar = prompt("Text Here")
document.getElementById("textAreaId").value;
isNaN(varHere) //Returns true or false.
19. Unlike ________________ identity operators do not perform type coercion.
standard equality operators
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
toPrecision(precision)
toUpperCase()
20. To get the current checked status of the control for radio buttons
prompt("Text Here")
getTime()
document.getElementById("radioButtonId").checked;
standard equality operators
21. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
Charset
toLowerCase()
prompt("Text Here")
<noscript>
22. A _______ variable can be changed and accessed from within and without a function or object.
substring(startIndex)
'
global
Math.pow(number, power)
23. Number object method used to round numbers to the specified number of decimal places
document.getElementById("spanId").firstChild;
toFixed(digits)
===
string
24. To code a button.onclick event handler
window.location = "New Web Address Here";
document.getElementById("ButtonId").onclick = functionName;
toExponential(digits)
Math.random() //Returns a value >= 0.0 but <1.0
25. To assign actions to the window onLoad event
toTimeString()
document.writeln("Text Here") //Advances to new line after text
getFullYear()
window.onload = function() {//actions here}
26. The string escape sequence to start a new line in JavaScript
confirm("Message Text Here")
document.getElementById("radioButtonId").checked;
toFixed(digitCount)
n
27. String object method used to return the position of the first instance of a specified search string starting from the specified index
indexOf(searchValue, startPosition)
document.getElementById("radioButtonId").value;
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Math.sqrt(number)
28. ________ comments start with / and end with /.
Multi line
toFixed(digitCount)
document.getElementById("textAreaId").value;
document.getElementById("spanId").firstChild;
29. To assign the value from a prompt to a string
var stringVar = prompt("Text Here")
v
global
Math.floor(number)
30. The string escape sequence to insert a carriage return in JavaScript
var variableName;
window.onload = function() {//actions here}
document.getElementById("textAreaId").value = "Text Value";
r
31. To assign a default value to a prompt
substring(startIndex)
Use the second parameter. Example: prompt("Enter Age:", "18")
document.getElementById("TextBoxId").value;
var dateVar = new Date()
32. To code a while statement in JavaScript
getTime()
while (condition) {}
document.getElementById("ButtonId").onclick = functionName;
confirm("Message Text Here")
33. To get the text value of the control for radio buttons
document.getElementById("radioButtonId").value;
standard equality operators
Math.min(var1, var2, varN)
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
34. Math object method used to return the highest value from a set of supplied numbers
document.getElementById("checkboxId").checked;
Math.max(var1, var2, varN)
var dateVar = new Date()
Either single or double quotes surrounding the data
35. The string escape sequence to insert a single quote in JavaScript
36. To create a new Date object
Use the second parameter. Example: prompt("Enter Age:", "18")
toString(base)
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
global
37. To code a for statement in JavaScript
<script type="text/javascript">.....</script>
toFixed(digits)
for (counter; condition; incrementor) {}
Math.sqrt(number)
38. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
Multi line
for (counter; condition; incrementor) {}
getFullYear()
confirm("Message Text Here")
39. To code an If statement in JavaScript
getTime()
document.getElementById("TextBoxId").focus;
f
if (condition) {}
40. To declare a variable in JavaScript
var variableName;
ondblclick
udddd
while (condition) {}
41. String object method used to get the character at a specified index position
toString(base)
toUpperCase()
r
charAt(position)
42. To alter the value of the text element in a span tag
getTime()
ondblclick
alert("Alert Text Here")
document.getElementById("spanId").firstChild.nodeValue = "New Value";
43. To write text to the current element of the DOM
window.location()
Underscores
document.getElementById("checkboxId").checked;
document.write("Text Here") //Remains on current line
44. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
Number.NEGATIVE_INFINITY
redeclare
if (condition) {}
Multi line
45. To create a Date object in JavaScript
var dateVar = new Date()
document.getElementById("radioButtonId").checked = true; //Could also be false
setMilliseconds()
Math.round(number)
46. Number object method used to return a string with a given number base
var stringVar = "part 1:" + "part 2";
toString(base)
Math.random() //Returns a value >= 0.0 but <1.0
toTimeString()
47. To create a single line comment in JavaScript
Src - e.g. <script src="fileName.js"> //
Two forward slashes "//"
Math.abs(number)
while (condition) {}
48. To get the current value for textboxes
document.getElementById("checkboxId").checked;
for (counter; condition; incrementor) {}
toTimeString()
document.getElementById("TextBoxId").value;
49. Date object method used to return a string containing the date and time
prompt("Text Here")
var arrayVar = new Array()
toString()
for (counter; condition; incrementor) {}
50. To display a confirmation
setMilliseconds()
if (condition) {}
confirm("Message Text Here")
substring(startIndex)