SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
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 identity operator for equals
for (counter; condition; incrementor) {}
Charset
Either single or double quotes surrounding the data
===
2. To set the control to be disabled for textboxes
document.getElementById("checkboxId").checked;
charAt(position)
Math.min(var1, var2, varN)
document.getElementById("TextBoxId").disabled = true;
3. To create a function in JavaScript
window.location = "New Web Address Here";
var functionName = function(param1, param2, paramN) {}
setMilliseconds()
Math.round(number)
4. To assign actions to the window onLoad event
window.onload = function() {//actions here}
getFullYear()
document.getElementById("checkboxId").value;
Math.pow(number, power)
5. To write a line to the current element of the DOM (Document Object Model)
expression
document.writeln("Text Here") //Advances to new line after text
document.getElementById("textAreaId").value = "Text Value";
event handler .
6. To declare a variable in JavaScript
standard equality operators
var variableName;
global
(Condition_Expression) ? Value_If_True : Value_If_False;
7. To access the text element in a <span> tag
toExponential(digits)
toFixed(digitCount)
document.getElementById("radioButtonId").value;
document.getElementById("spanId").firstChild;
8. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________
var answerVar = confirm("Message Text Here")
Math.pow(number, power)
setMilliseconds()
Src - e.g. <script src="fileName.js"> //
9. To get the current value for textboxes
Math.random() //Returns a value >= 0.0 but <1.0
document.getElementById("TextBoxId").value;
if (condition) {}
'
10. To get the value or the currently selected item for lists
document.getElementById("CheckboxId").checked = true; //Could also be false
if (condition) {}
window.location = "New Web Address Here";
document.getElementById("listId").value;
11. The escape sequence used to insert a Unicode character into a string in JavaScript
udddd
substring(startIndex)
var variableName;
var functionName = function(param1, param2, paramN) {}
12. Statements end in JavaScript with a ________
window.onload = function() {//actions here}
semicolon ";"
getTime()
Objects
13. Math object method used to return the highest value from a set of supplied numbers
Math.max(var1, var2, varN)
substring(startIndex)
redeclare
string
14. A _______ variable can be changed and accessed from within and without a function or object.
Math.floor(number)
alert("Alert Text Here")
document.getElementById("checkboxId").value;
global
15. The string escape sequence to insert a double quote in JavaScript
"
string
var arrayVar = new Array()
Math.round(number)
16. Math object method used to return a given number rounded to the next highest integer value
Math.max(var1, var2, varN)
f
toDateString()
Math.ceil(number)
17. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
t
<noscript>
focus
document.write("Text Here") //Remains on current line
18. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
redeclare
focus
document.getElementById(id)
alert("Alert Text Here")
19. The four attributes of the <script> tag:Type - Src - _____ and Defer
charAt(position)
Charset
var functionName = function(param1, param2, paramN) {}
n
20. String object method used to get the character at a specified index position
charAt(position)
var stringVar = prompt("Text Here")
window.location()
Math.sqrt(number)
21. To get the text value of the control for radio buttons
document.getElementById("checkboxId").value;
var stringVar = "part 1:" + "part 2";
Math.pow(number, power)
substring(startIndex, stopIndex)
22. A statement that yields a value
t
expression
toExponential(digits)
Math.random() //Returns a value >= 0.0 but <1.0
23. Unlike ________________ identity operators do not perform type coercion.
Math.sqrt(number)
semicolon ";"
standard equality operators
\
24. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
Objects
toDateString()
document.getElementById("radioButtonId").value;
r
25. To create a Date object in JavaScript
document.getElementById("radioButtonId").value;
document.getElementById("listId").value;
var dateVar = new Date()
udddd
26. To denote a string in JavaScript
toFixed(digits)
document.getElementById("TextBoxId").focus;
for (counter; condition; incrementor) {}
Either single or double quotes surrounding the data
27. To view the current web address using JavaScript
window.location()
document.getElementById("checkboxId").value;
var dateObject = new Date("11/22/2012 18:25:35")
toFixed(digits)
28. Number object method used to round numbers to the specified number of decimal places
var dateObject = new Date("11/22/2012 18:25:35")
Use the second parameter. Example: prompt("Enter Age:", "18")
alert("Alert Text Here")
toFixed(digits)
29. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
var answerVar = confirm("Message Text Here")
Underscores
Math.sqrt(number)
getFullYear()
30. The identity operator for not equal
!==
document.getElementById("listId").value;
event handler .
Charset
31. To make the browser load a new page using JavaScript
var variableName;
Underscores
window.location = "New Web Address Here";
global
32. The string escape sequence to start a new line in JavaScript
Math.random() //Returns a value >= 0.0 but <1.0
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
n
standard equality operators
33. To create a new Date object
charAt(position)
substring(startIndex)
document.getElementById("CheckboxId").checked = true; //Could also be false
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
34. To set the current checked status of the control for checkboxes
concat(var1, var2, varN)
document.getElementById("CheckboxId").checked = true; //Could also be false
document.getElementById("TextBoxId").disabled = true;
===
35. To assign the value from a prompt to a non-string variable
setMilliseconds()
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
prompt("Text Here")
(Condition_Expression) ? Value_If_True : Value_If_False;
36. To assign the return value of confirm() to a variable
Either single or double quotes surrounding the data
toExponential(digits)
var answerVar = confirm("Message Text Here")
document.getElementById("checkboxId").value;
37. The string escape sequence to insert a vertical tab in JavaScript
document.getElementById("radioButtonId").checked = true; //Could also be false
confirm("Message Text Here")
var functionName = function(param1, param2, paramN) {}
v
38. The string escape sequence to insert a carriage return in JavaScript
r
window.location()
string
confirm()
39. To set the digit precision of a decimal number
toDateString()
Objects
document.getElementById("textAreaId").value = "Text Value";
toFixed(digitCount)
40. Math object method used to return the lowest value for a set of supplied numbers
Two forward slashes "//"
toString(base)
toFixed(digits)
Math.min(var1, var2, varN)
41. Date object method used to return a string containing the date
r
var answerVar = confirm("Message Text Here")
Math.ceil(number)
toDateString()
42. To display a confirmation
confirm("Message Text Here")
document.getElementById("radioButtonId").checked = true; //Could also be false
"
redeclare
43. ________ comments start with / and end with /.
var dateObject = new Date("11/22/2012 18:25:35")
var dateVar = new Date()
Multi line
concat(var1, var2, varN)
44. To insert Javascript into a web page
Two forward slashes "//"
<script type="text/javascript">.....</script>
v
document.getElementById("radioButtonId").checked;
45. Math object method used to return the absolute value of a given number
Math.max(var1, var2, varN)
Math.abs(number)
ondblclick
var answerVar = confirm("Message Text Here")
46. 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)
getFullYear()
event handler .
47. To concatenate multiple parts into a string
var stringVar = "part 1:" + "part 2";
toTimeString()
===
global
48. When you add a string and a number the result will be a ____
getTime()
alert("Alert Text Here")
document.getElementById("checkboxId").value;
string
49. What String object method returns a new string containing the value of the original string but in all lower case
toFixed(digitCount)
toLowerCase()
substring(startIndex)
document.getElementById("checkboxId").checked;
50. To test that a variable contains a valid number
document.getElementById("radioButtonId").value;
document.getElementById("checkboxId").value;
isNaN(varHere) //Returns true or false.
Either single or double quotes surrounding the data