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. To display an alert
alert("Alert Text Here")
Charset
Math.floor(number)
toString(base)
2. To denote a string in JavaScript
Either single or double quotes surrounding the data
alert("Alert Text Here")
r
var dateVar = new Date()
3. What String object method returns a new string containing the value of the original string but in all upper case
indexOf(searchValue, startPosition)
"
toUpperCase()
t
4. 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
semicolon ";"
document.getElementById("listId").value;
alert("Alert Text Here")
substring(startIndex, stopIndex)
5. The string escape sequence to insert a tab in JavaScript
Math.round(number)
<script type="text/javascript">.....</script>
t
window.location = "New Web Address Here";
6. This returns only True or false values
toString(base)
prompt("Text Here")
confirm()
toLowerCase()
7. The escape sequence used to insert a Unicode character into a string in JavaScript
udddd
window.onload = function() {//actions here}
if (condition) {}
<script type="text/javascript">.....</script>
8. To assign a default value to a prompt
Two forward slashes "//"
ondblclick
Use the second parameter. Example: prompt("Enter Age:", "18")
Number.NEGATIVE_INFINITY
9. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
f
toExponential(digits)
event handler .
document.getElementById("listId").value;
10. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
Objects
standard equality operators
n
document.getElementById("radioButtonId").checked = true; //Could also be false
11. To get the current checked status of the control for checkboxes
substring(startIndex)
document.getElementById("checkboxId").checked;
var dateObject = new Date("11/22/2012 18:25:35")
(Condition_Expression) ? Value_If_True : Value_If_False;
12. Unlike ________________ identity operators do not perform type coercion.
Math.pow(number, power)
toPrecision(precision)
var variableName;
standard equality operators
13. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
Number.NEGATIVE_INFINITY
getFullYear()
string
isNaN(varHere) //Returns true or false.
14. The string escape sequence to start a new line in JavaScript
Objects
global
setMilliseconds()
n
15. String object method used to get the character at a specified index position
charAt(position)
\
<noscript>
toString()
16. To alter the value of the text element in a span tag
document.getElementById("spanId").firstChild.nodeValue = "New Value";
Multi line
Math.sqrt(number)
var functionName = function(param1, param2, paramN) {}
17. To code an If statement in JavaScript
if (condition) {}
document.getElementById(id)
document.getElementById("listId").value;
toPrecision(precision)
18. To assign the value from a prompt to a string
f
var stringVar = prompt("Text Here")
toUpperCase()
Math.random() //Returns a value >= 0.0 but <1.0
19. The format to create a new Date object from a string
document.getElementById(id)
var dateObject = new Date("11/22/2012 18:25:35")
r
redeclare
20. A _______ variable can be changed and accessed from within and without a function or object.
n
isNaN(varHere) //Returns true or false.
!==
global
21. JavaScript is case _______
<noscript>
sensitive
document.getElementById("spanId").firstChild;
toFixed(digitCount)
22. To view the current web address using JavaScript
window.location()
document.getElementById("radioButtonId").checked;
toDateString()
getTime()
23. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
confirm("Message Text Here")
expression
focus
Charset
24. To make the browser load a new page using JavaScript
Math.random() //Returns a value >= 0.0 but <1.0
while (condition) {}
window.location = "New Web Address Here";
var stringVar = "part 1:" + "part 2";
25. 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
26. To code a for statement in JavaScript
for (counter; condition; incrementor) {}
substring(startIndex)
var arrayVar = new Array()
window.onload = function() {//actions here}
27. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
ondblclick
Number.NEGATIVE_INFINITY
<noscript>
!==
28. The identity operator for not equal
toFixed(digitCount)
Math.pow(number, power)
for (counter; condition; incrementor) {}
!==
29. To create an Array object in JavaScript
var arrayVar = new Array()
document.writeln("Text Here") //Advances to new line after text
toPrecision(precision)
Use the second parameter. Example: prompt("Enter Age:", "18")
30. The string escape sequence to insert a vertical tab in JavaScript
t
v
Math.floor(number)
prompt("Text Here")
31. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
Underscores
focus
Use the second parameter. Example: prompt("Enter Age:", "18")
'
32. To concatenate multiple parts into a string
toString()
toPrecision(precision)
var stringVar = "part 1:" + "part 2";
semicolon ";"
33. To get the text value of the control for radio buttons
Underscores
Charset
Src - e.g. <script src="fileName.js"> //
document.getElementById("checkboxId").value;
34. Command to display a prompt
!==
Number.NEGATIVE_INFINITY
prompt("Text Here")
concat(var1, var2, varN)
35. The string escape sequence to insert a backslash in JavaScript
window.onload = function() {//actions here}
document.getElementById("listId").value;
\
Src - e.g. <script src="fileName.js"> //
36. To assign actions to the window onLoad event
Math.abs(number)
document.getElementById("radioButtonId").checked;
window.onload = function() {//actions here}
n
37. To get the current value of the control for a text area
Math.random() //Returns a value >= 0.0 but <1.0
event handler .
document.getElementById("textAreaId").value;
ondblclick
38. The syntax of a conditional operator
toFixed(digitCount)
getFullYear()
(Condition_Expression) ? Value_If_True : Value_If_False;
Number.NEGATIVE_INFINITY
39. A statement that yields a value
document.getElementById("TextBoxId").focus;
Math.ceil(number)
Math.min(var1, var2, varN)
expression
40. To create a Date object in JavaScript
var variableName;
document.getElementById("CheckboxId").checked = true; //Could also be false
if (condition) {}
var dateVar = new Date()
41. Math object method used to return a random number
r
toPrecision(precision)
document.writeln("Text Here") //Advances to new line after text
Math.random() //Returns a value >= 0.0 but <1.0
42. String object method used to return the position of the first instance of a specified search string starting from the specified index
setMilliseconds()
indexOf(searchValue, startPosition)
n
document.getElementById("radioButtonId").checked;
43. Statements end in JavaScript with a ________
var dateObject = new Date("11/22/2012 18:25:35")
semicolon ";"
prompt("Text Here")
expression
44. To set the current checked status of the control for checkboxes
document.getElementById("CheckboxId").checked = true; //Could also be false
expression
document.getElementById("TextBoxId").focus;
document.writeln("Text Here") //Advances to new line after text
45. String object method used to return a new string that contains part of the original string from the specified start position
getFullYear()
substring(startIndex)
Use the second parameter. Example: prompt("Enter Age:", "18")
(Condition_Expression) ? Value_If_True : Value_If_False;
46. Math object method used to return the lowest value for a set of supplied numbers
toDateString()
Math.min(var1, var2, varN)
var variableName;
udddd
47. Math object method used to return the highest value from a set of supplied numbers
Math.max(var1, var2, varN)
Math.sqrt(number)
n
setMilliseconds()
48. To write text to the current element of the DOM
Math.round(number)
Math.floor(number)
document.write("Text Here") //Remains on current line
getTime()
49. The _____ attribute is used to denote external file for script use
Src - e.g. <script src="fileName.js"> //
redeclare
document.getElementById("spanId").firstChild;
substring(startIndex, stopIndex)
50. To create a single line comment in JavaScript
standard equality operators
Two forward slashes "//"
while (condition) {}
Use the second parameter. Example: prompt("Enter Age:", "18")