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 string escape sequence to insert a tab in JavaScript
===
charAt(position)
t
<noscript>
2. To declare a variable in JavaScript
var answerVar = confirm("Message Text Here")
getTime()
var variableName;
ondblclick
3. To get the current value for textboxes
var functionName = function(param1, param2, paramN) {}
document.getElementById("TextBoxId").value;
<script type="text/javascript">.....</script>
document.getElementById("radioButtonId").checked = true; //Could also be false
4. The escape sequence used to insert a Unicode character into a string in JavaScript
Math.abs(number)
event handler .
sensitive
udddd
5. What String object method returns a new string containing the value of the original string but in all upper case
toUpperCase()
sensitive
toTimeString()
Underscores
6. The four attributes of the <script> tag:Type - Src - _____ and Defer
v
Math.min(var1, var2, varN)
var arrayVar = new Array()
Charset
7. The string escape sequence to insert a vertical tab in JavaScript
v
var stringVar = "part 1:" + "part 2";
substring(startIndex)
toString(base)
8. Date object method used to return a string containing the time
toTimeString()
<noscript>
redeclare
var stringVar = "part 1:" + "part 2";
9. To get the value or the currently selected item for lists
document.getElementById("listId").value;
Either single or double quotes surrounding the data
ondblclick
window.location = "New Web Address Here";
10. To set the digit precision of a decimal number
document.getElementById("CheckboxId").checked = true; //Could also be false
toFixed(digitCount)
var arrayVar = new Array()
charAt(position)
11. Math object method used to return a given number raised to a given power
document.getElementById("listId").value;
substring(startIndex, stopIndex)
Math.pow(number, power)
var stringVar = prompt("Text Here")
12. To create a Date object in JavaScript
var dateVar = new Date()
Math.random() //Returns a value >= 0.0 but <1.0
window.onload = function() {//actions here}
toTimeString()
13. To concatenate multiple parts into a string
r
var stringVar = "part 1:" + "part 2";
udddd
toTimeString()
14. To insert Javascript into a web page
<script type="text/javascript">.....</script>
"
confirm("Message Text Here")
window.location()
15. When you add a string and a number the result will be a ____
string
global
var answerVar = confirm("Message Text Here")
v
16. JavaScript is case _______
sensitive
confirm()
document.getElementById("CheckboxId").checked = true; //Could also be false
'
17. To access the text element in a <span> tag
redeclare
var functionName = function(param1, param2, paramN) {}
Underscores
document.getElementById("spanId").firstChild;
18. To create a new Date object
Math.sqrt(number)
!==
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
(Condition_Expression) ? Value_If_True : Value_If_False;
19. Math object method used to return the absolute value of a given number
indexOf(searchValue, startPosition)
\
Math.abs(number)
Two forward slashes "//"
20. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
event handler .
ondblclick
Objects
udddd
21. Unlike ________________ identity operators do not perform type coercion.
standard equality operators
window.onload = function() {//actions here}
===
toFixed(digitCount)
22. The string escape sequence to insert a backslash in JavaScript
Math.random() //Returns a value >= 0.0 but <1.0
\
semicolon ";"
Math.round(number)
23. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
event handler .
sensitive
Math.max(var1, var2, varN)
Math.ceil(number)
24. Math object method used to return a given number that has been rounded to the closes integer value
Math.round(number)
Underscores
confirm("Message Text Here")
Math.max(var1, var2, varN)
25. To assign the return value of confirm() to a variable
n
event handler .
document.getElementById(id)
var answerVar = confirm("Message Text Here")
26. The string escape sequence to insert a double quote in JavaScript
var stringVar = "part 1:" + "part 2";
substring(startIndex, stopIndex)
var arrayVar = new Array()
"
27. To create a single line comment in JavaScript
alert("Alert Text Here")
window.onload = function() {//actions here}
for (counter; condition; incrementor) {}
Two forward slashes "//"
28. To assign actions to the window onLoad event
setMilliseconds()
document.getElementById("listId").value;
window.onload = function() {//actions here}
n
29. To set the current value of the control for a text area
Math.floor(number)
redeclare
document.getElementById("textAreaId").value = "Text Value";
window.location()
30. To assign the value from a prompt to a string
var stringVar = prompt("Text Here")
document.getElementById("radioButtonId").checked = true; //Could also be false
toString()
toString(base)
31. To write text to the current element of the DOM
for (counter; condition; incrementor) {}
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
document.getElementById("radioButtonId").checked;
document.write("Text Here") //Remains on current line
32. A _______ variable can be changed and accessed from within and without a function or object.
global
document.getElementById("checkboxId").value;
var arrayVar = new Array()
document.getElementById(id)
33. The string escape sequence to start a new line in JavaScript
event handler .
n
confirm()
Math.random() //Returns a value >= 0.0 but <1.0
34. The string escape sequence to insert a form feed in JavaScript
f
Objects
var answerVar = confirm("Message Text Here")
Math.sqrt(number)
35. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
Underscores
while (condition) {}
<noscript>
var stringVar = "part 1:" + "part 2";
36. Statements end in JavaScript with a ________
semicolon ";"
document.getElementById("TextBoxId").disabled = true;
Either single or double quotes surrounding the data
var stringVar = prompt("Text Here")
37. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
var functionName = function(param1, param2, paramN) {}
document.getElementById("TextBoxId").value;
Number.NEGATIVE_INFINITY
toTimeString()
38. To code a for statement in JavaScript
Charset
Src - e.g. <script src="fileName.js"> //
===
for (counter; condition; incrementor) {}
39. To set the current checked status of the control for checkboxes
semicolon ";"
'
var variableName;
document.getElementById("CheckboxId").checked = true; //Could also be false
40. 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)
Objects
focus
41. To create an Array object in JavaScript
var arrayVar = new Array()
var functionName = function(param1, param2, paramN) {}
var dateObject = new Date("11/22/2012 18:25:35")
prompt("Text Here")
42. The _____ attribute is used to denote external file for script use
Src - e.g. <script src="fileName.js"> //
Math.random() //Returns a value >= 0.0 but <1.0
document.getElementById("radioButtonId").checked = true; //Could also be false
document.getElementById("TextBoxId").value;
43. To assign the value from a prompt to a non-string variable
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
while (condition) {}
<script type="text/javascript">.....</script>
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
44. To alter the value of the text element in a span tag
Math.pow(number, power)
document.getElementById("spanId").firstChild;
document.getElementById("spanId").firstChild.nodeValue = "New Value";
toLowerCase()
45. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
Math.ceil(number)
focus
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Math.max(var1, var2, varN)
46. This returns only True or false values
isNaN(varHere) //Returns true or false.
var dateVar = new Date()
window.location = "New Web Address Here";
confirm()
47. Number object method used to return a string with a given number base
var functionName = function(param1, param2, paramN) {}
Math.min(var1, var2, varN)
toString(base)
Number.NEGATIVE_INFINITY
48. ________ comments start with / and end with /.
redeclare
document.getElementById("ButtonId").onclick = functionName;
Multi line
var functionName = function(param1, param2, paramN) {}
49. 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
sensitive
"
Use the second parameter. Example: prompt("Enter Age:", "18")
substring(startIndex, stopIndex)
50. Number object method used to return a number in exponential format with the specified number of decimal places
toFixed(digits)
Math.ceil(number)
toExponential(digits)
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))