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 vertical tab in JavaScript
v
expression
getTime()
Use the second parameter. Example: prompt("Enter Age:", "18")
2. To create a Date object in JavaScript
semicolon ";"
document.writeln("Text Here") //Advances to new line after text
expression
var dateVar = new Date()
3. The string escape sequence to insert a backslash in JavaScript
document.getElementById("CheckboxId").checked = true; //Could also be false
\
toFixed(digitCount)
document.getElementById("radioButtonId").checked = true; //Could also be false
4. The format to create a new Date object from a string
substring(startIndex, stopIndex)
var functionName = function(param1, param2, paramN) {}
var dateObject = new Date("11/22/2012 18:25:35")
string
5. A statement that yields a value
expression
r
toDateString()
<noscript>
6. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
confirm("Message Text Here")
document.getElementById("radioButtonId").checked;
v
Objects
7. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
semicolon ";"
toExponential(digits)
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
event handler .
8. To create a function that returns a value in JavaScript
var functionName = function(param1, param2, paramN) {}
document.getElementById("TextBoxId").focus;
toTimeString()
document.getElementById(id)
9. The identity operator for equals
document.getElementById("radioButtonId").checked;
===
Math.ceil(number)
semicolon ";"
10. A _______ variable can be changed and accessed from within and without a function or object.
<noscript>
semicolon ";"
document.getElementById("TextBoxId").focus;
global
11. The four attributes of the <script> tag:Type - Src - _____ and Defer
Charset
Math.pow(number, power)
document.getElementById("listId").value;
var functionName = function(param1, param2, paramN) {}
12. The string escape sequence to insert a tab in JavaScript
window.onload = function() {//actions here}
Math.random() //Returns a value >= 0.0 but <1.0
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
t
13. Statements end in JavaScript with a ________
semicolon ";"
toString(base)
var stringVar = prompt("Text Here")
toTimeString()
14. To alter the value of the text element in a span tag
document.getElementById("TextBoxId").value;
Math.min(var1, var2, varN)
document.getElementById("spanId").firstChild.nodeValue = "New Value";
document.getElementById(id)
15. When you add a string and a number the result will be a ____
toLowerCase()
string
f
Underscores
16. The string escape sequence to insert a carriage return in JavaScript
redeclare
<noscript>
r
'
17. Date object method used to return a string containing the date
toDateString()
<noscript>
event handler .
Number.NEGATIVE_INFINITY
18. To get the value or the currently selected item for lists
document.getElementById("listId").value;
Math.max(var1, var2, varN)
indexOf(searchValue, startPosition)
semicolon ";"
19. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
getFullYear()
standard equality operators
Multi line
window.location = "New Web Address Here";
20. Math object method used to return a given number rounded to the next lowest integer value
Math.floor(number)
Number.NEGATIVE_INFINITY
while (condition) {}
indexOf(searchValue, startPosition)
21. What Date object method is used to return the number of milliseconds since the start of GMT
window.location = "New Web Address Here";
document.getElementById("spanId").firstChild.nodeValue = "New Value";
standard equality operators
getTime()
22. Number object method used to return a number in exponential format with the specified number of decimal places
document.write("Text Here") //Remains on current line
var functionName = function(param1, param2, paramN) {}
toExponential(digits)
standard equality operators
23. To write a line to the current element of the DOM (Document Object Model)
document.getElementById("spanId").firstChild.nodeValue = "New Value";
while (condition) {}
toString(base)
document.writeln("Text Here") //Advances to new line after text
24. String object method used to concatenate multiple strings
prompt("Text Here")
string
document.getElementById("spanId").firstChild;
concat(var1, var2, varN)
25. What String object method returns a new string containing the value of the original string but in all lower case
Math.abs(number)
document.write("Text Here") //Remains on current line
document.getElementById("listId").value;
toLowerCase()
26. The string escape sequence to start a new line in JavaScript
toUpperCase()
Charset
n
Math.sqrt(number)
27. To view the current web address using JavaScript
window.location()
Math.abs(number)
\
toFixed(digits)
28. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
var variableName;
alert("Alert Text Here")
window.location = "New Web Address Here";
Number.NEGATIVE_INFINITY
29. Math object method used to return the absolute value of a given number
window.location = "New Web Address Here";
Math.abs(number)
ondblclick
f
30. String object method used to return a new string that contains part of the original string from the specified start position
Src - e.g. <script src="fileName.js"> //
<script type="text/javascript">.....</script>
substring(startIndex, stopIndex)
substring(startIndex)
31. JavaScript is case _______
Two forward slashes "//"
sensitive
var dateObject = new Date("11/22/2012 18:25:35")
event handler .
32. Number object method used to round numbers to the specified number of decimal places
===
isNaN(varHere) //Returns true or false.
var arrayVar = new Array()
toFixed(digits)
33. To get the current checked status of the control for radio buttons
document.getElementById("ButtonId").onclick = functionName;
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
toExponential(digits)
document.getElementById("radioButtonId").checked;
34. ________ comments start with / and end with /.
Multi line
var functionName = function(param1, param2, paramN) {}
f
Math.min(var1, var2, varN)
35. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________
setMilliseconds()
t
Math.pow(number, power)
document.getElementById("TextBoxId").focus;
36. To get the current value of the control for a text area
toUpperCase()
document.write("Text Here") //Remains on current line
document.getElementById("textAreaId").value;
Underscores
37. To set the current value of the control for a text area
getFullYear()
r
for (counter; condition; incrementor) {}
document.getElementById("textAreaId").value = "Text Value";
38. Math object method used to return a given number rounded to the next highest integer value
document.getElementById("checkboxId").value;
Math.min(var1, var2, varN)
Math.ceil(number)
Either single or double quotes surrounding the data
39. To assign the value from a prompt to a string
toExponential(digits)
var stringVar = prompt("Text Here")
Math.min(var1, var2, varN)
var stringVar = "part 1:" + "part 2";
40. What String object method returns a new string containing the value of the original string but in all upper case
if (condition) {}
var arrayVar = new Array()
toUpperCase()
toTimeString()
41. To assign the return value of confirm() to a variable
var answerVar = confirm("Message Text Here")
expression
event handler .
Use the second parameter. Example: prompt("Enter Age:", "18")
42. The string escape sequence to insert a single quote in JavaScript
Warning
: Invalid argument supplied for foreach() in
/var/www/html/basicversity.com/show_quiz.php
on line
183
43. Date object method used to return a string containing the time
Multi line
document.getElementById("listId").value;
<noscript>
toTimeString()
44. The string escape sequence to insert a double quote in JavaScript
Src - e.g. <script src="fileName.js"> //
toString(base)
"
document.getElementById(id)
45. Date object method used to return a string containing the date and time
document.getElementById("radioButtonId").checked;
toString()
var functionName = function(param1, param2, paramN) {}
confirm("Message Text Here")
46. To code an If statement in JavaScript
document.getElementById("TextBoxId").focus;
if (condition) {}
toPrecision(precision)
Math.max(var1, var2, varN)
47. The events common to most controls: onfocus - onblur - onclick - _______ - onchange - onselect
toFixed(digitCount)
global
Src - e.g. <script src="fileName.js"> //
ondblclick
48. Math object method used to return the highest value from a set of supplied numbers
var answerVar = confirm("Message Text Here")
Math.max(var1, var2, varN)
document.getElementById("CheckboxId").checked = true; //Could also be false
toExponential(digits)
49. The string escape sequence to insert a form feed in JavaScript
confirm()
f
Objects
Src - e.g. <script src="fileName.js"> //
50. Command to display a prompt
semicolon ";"
Math.floor(number)
if (condition) {}
prompt("Text Here")