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. Date object method used to return a string containing the date and time
Number.NEGATIVE_INFINITY
getFullYear()
confirm("Message Text Here")
toString()
2. Command to display a prompt
document.getElementById("checkboxId").checked;
standard equality operators
Math.floor(number)
prompt("Text Here")
3. To denote a string in JavaScript
(Condition_Expression) ? Value_If_True : Value_If_False;
Either single or double quotes surrounding the data
confirm("Message Text Here")
Math.sqrt(number)
4. To create a function in JavaScript
var dateObject = new Date("11/22/2012 18:25:35")
document.getElementById("textAreaId").value;
Src - e.g. <script src="fileName.js"> //
var functionName = function(param1, param2, paramN) {}
5. To assign a default value to a prompt
Use the second parameter. Example: prompt("Enter Age:", "18")
document.getElementById("spanId").firstChild;
var variableName;
r
6. To create a function that returns a value in JavaScript
redeclare
Multi line
var functionName = function(param1, param2, paramN) {}
Math.ceil(number)
7. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
var functionName = function(param1, param2, paramN) {}
substring(startIndex)
event handler .
8. Math object method used to return a random number
window.location()
document.getElementById("checkboxId").checked;
toDateString()
Math.random() //Returns a value >= 0.0 but <1.0
9. To set focus on the control for textboxes
Math.abs(number)
toDateString()
document.getElementById("TextBoxId").focus;
substring(startIndex, stopIndex)
10. Math object method used to return the absolute value of a given number
Math.abs(number)
document.getElementById("textAreaId").value = "Text Value";
var variableName;
document.getElementById("radioButtonId").value;
11. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
<noscript>
setMilliseconds()
"
Math.abs(number)
12. This returns only True or false values
string
!==
confirm()
setMilliseconds()
13. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________
charAt(position)
setMilliseconds()
var arrayVar = new Array()
Math.min(var1, var2, varN)
14. ________ comments start with / and end with /.
indexOf(searchValue, startPosition)
Multi line
f
substring(startIndex)
15. To view the current web address using JavaScript
window.location()
Either single or double quotes surrounding the data
\
isNaN(varHere) //Returns true or false.
16. To set the control to be disabled for textboxes
document.getElementById("TextBoxId").disabled = true;
Two forward slashes "//"
document.getElementById("listId").value;
Math.floor(number)
17. To code a for statement in JavaScript
document.getElementById("TextBoxId").disabled = true;
Underscores
<script type="text/javascript">.....</script>
for (counter; condition; incrementor) {}
18. To display an alert
Math.ceil(number)
alert("Alert Text Here")
redeclare
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
19. To insert Javascript into a web page
<script type="text/javascript">.....</script>
var functionName = function(param1, param2, paramN) {}
confirm("Message Text Here")
document.getElementById(id)
20. String object method used to get the character at a specified index position
document.getElementById("checkboxId").value;
expression
charAt(position)
v
21. Number object method used to return a numerical string with the specified number of significant digits
toPrecision(precision)
Underscores
(Condition_Expression) ? Value_If_True : Value_If_False;
expression
22. Math object method used to return a given number raised to a given power
Number.NEGATIVE_INFINITY
f
Charset
Math.pow(number, power)
23. The syntax of a conditional operator
expression
for (counter; condition; incrementor) {}
(Condition_Expression) ? Value_If_True : Value_If_False;
var dateVar = new Date()
24. To assign the return value of confirm() to a variable
var answerVar = confirm("Message Text Here")
charAt(position)
document.getElementById("checkboxId").checked;
redeclare
25. Math object method used to return the lowest value for a set of supplied numbers
Math.min(var1, var2, varN)
Charset
toPrecision(precision)
var dateVar = new Date()
26. 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
substring(startIndex, stopIndex)
charAt(position)
substring(startIndex)
Either single or double quotes surrounding the data
27. To create a new Date object
document.getElementById("textAreaId").value = "Text Value";
document.getElementById(id)
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
Charset
28. Number object method used to return a number in exponential format with the specified number of decimal places
Math.round(number)
document.getElementById("textAreaId").value;
toExponential(digits)
document.getElementById("spanId").firstChild.nodeValue = "New Value";
29. String object method used to concatenate multiple strings
concat(var1, var2, varN)
Src - e.g. <script src="fileName.js"> //
toFixed(digits)
document.getElementById("TextBoxId").disabled = true;
30. To test that a variable contains a valid number
window.location = "New Web Address Here";
var variableName;
isNaN(varHere) //Returns true or false.
document.getElementById("TextBoxId").disabled = true;
31. To get the current checked status of the control for radio buttons
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
document.getElementById("radioButtonId").checked;
var functionName = function(param1, param2, paramN) {}
document.getElementById("checkboxId").checked;
32. To get the text value of the control for radio buttons
document.getElementById("checkboxId").value;
Math.pow(number, power)
document.getElementById("TextBoxId").value;
confirm()
33. Number object method used to round numbers to the specified number of decimal places
document.getElementById("spanId").firstChild;
toFixed(digits)
t
var stringVar = "part 1:" + "part 2";
34. The string escape sequence to insert a carriage return in JavaScript
if (condition) {}
f
global
r
35. The string escape sequence to start a new line in JavaScript
Use the second parameter. Example: prompt("Enter Age:", "18")
Charset
n
while (condition) {}
36. The four attributes of the <script> tag:Type - Src - _____ and Defer
document.getElementById("CheckboxId").checked = true; //Could also be false
confirm()
var dateObject = new Date("11/22/2012 18:25:35")
Charset
37. A statement that yields a value
global
document.getElementById("spanId").firstChild.nodeValue = "New Value";
expression
f
38. Math object method used to return a given number rounded to the next lowest integer value
substring(startIndex)
document.getElementById("TextBoxId").value;
Math.floor(number)
window.location = "New Web Address Here";
39. The identity operator for equals
while (condition) {}
Underscores
===
var variableName;
40. The string escape sequence to insert a backslash in JavaScript
toPrecision(precision)
Math.pow(number, power)
\
Math.min(var1, var2, varN)
41. To create a single line comment in JavaScript
expression
toString()
indexOf(searchValue, startPosition)
Two forward slashes "//"
42. To set the digit precision of a decimal number
Math.ceil(number)
document.getElementById("radioButtonId").value;
global
toFixed(digitCount)
43. To declare a variable in JavaScript
document.getElementById("TextBoxId").disabled = true;
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
var functionName = function(param1, param2, paramN) {}
var variableName;
44. The format to create a new Date object from a string
var dateObject = new Date("11/22/2012 18:25:35")
Math.max(var1, var2, varN)
===
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
45. When you __________ a javascript variable it retains its original value
redeclare
toExponential(digits)
toPrecision(precision)
sensitive
46. Math object method used to return a given number that has been rounded to the closes integer value
expression
while (condition) {}
Math.round(number)
toLowerCase()
47. The events common to most controls: onfocus - onblur - onclick - _______ - onchange - onselect
var functionName = function(param1, param2, paramN) {}
ondblclick
Underscores
document.getElementById(id)
48. To assign the value from a prompt to a non-string variable
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Either single or double quotes surrounding the data
while (condition) {}
Math.min(var1, var2, varN)
49. To access the text element in a <span> tag
Charset
document.getElementById(id)
Math.min(var1, var2, varN)
document.getElementById("spanId").firstChild;
50. To get the current checked status of the control for checkboxes
document.getElementById("checkboxId").checked;
var dateObject = new Date("11/22/2012 18:25:35")
concat(var1, var2, varN)
window.location = "New Web Address Here";