SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
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. String object method used to return the position of the first instance of a specified search string starting from the specified index
var stringVar = prompt("Text Here")
sensitive
document.getElementById("TextBoxId").value;
indexOf(searchValue, startPosition)
2. String object method used to return a new string that contains part of the original string from the specified start position
Math.pow(number, power)
Math.round(number)
substring(startIndex)
Math.max(var1, var2, varN)
3. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
document.getElementById("listId").value;
Src - e.g. <script src="fileName.js"> //
charAt(position)
event handler .
4. What String object method returns a new string containing the value of the original string but in all upper case
charAt(position)
toUpperCase()
document.getElementById("TextBoxId").focus;
n
5. The four attributes of the <script> tag:Type - Src - _____ and Defer
Charset
var dateVar = new Date()
Two forward slashes "//"
document.writeln("Text Here") //Advances to new line after text
6. The string escape sequence to insert a backslash in JavaScript
===
\
alert("Alert Text Here")
document.getElementById("radioButtonId").checked;
7. Statements end in JavaScript with a ________
Two forward slashes "//"
semicolon ";"
charAt(position)
Src - e.g. <script src="fileName.js"> //
8. To access a page element by id
redeclare
document.getElementById(id)
toString()
t
9. What String object method returns a new string containing the value of the original string but in all lower case
toLowerCase()
window.onload = function() {//actions here}
expression
var answerVar = confirm("Message Text Here")
10. To create a new Date object
Math.round(number)
alert("Alert Text Here")
Math.floor(number)
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
11. To set the current checked status of the control for radio buttons
document.getElementById("radioButtonId").checked = true; //Could also be false
var variableName;
Math.abs(number)
var functionName = function(param1, param2, paramN) {}
12. To get the current value of the control for a text area
var arrayVar = new Array()
document.getElementById("textAreaId").value;
\
document.write("Text Here") //Remains on current line
13. To create an Array object in JavaScript
var arrayVar = new Array()
toUpperCase()
focus
n
14. To create a single line comment in JavaScript
Two forward slashes "//"
document.getElementById("spanId").firstChild;
document.getElementById("checkboxId").checked;
var stringVar = "part 1:" + "part 2";
15. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________
document.getElementById("checkboxId").checked;
setMilliseconds()
toUpperCase()
document.getElementById("radioButtonId").value;
16. To get the current value for textboxes
document.getElementById("TextBoxId").value;
var functionName = function(param1, param2, paramN) {}
for (counter; condition; incrementor) {}
Charset
17. To display an alert
Math.abs(number)
alert("Alert Text Here")
setMilliseconds()
var variableName;
18. To concatenate multiple parts into a string
Src - e.g. <script src="fileName.js"> //
var stringVar = "part 1:" + "part 2";
toPrecision(precision)
Multi line
19. A _______ variable can be changed and accessed from within and without a function or object.
global
Math.max(var1, var2, varN)
substring(startIndex)
var answerVar = confirm("Message Text Here")
20. The events common to most controls: onfocus - onblur - onclick - _______ - onchange - onselect
Charset
ondblclick
document.write("Text Here") //Remains on current line
confirm("Message Text Here")
21. To write text to the current element of the DOM
Math.round(number)
expression
global
document.write("Text Here") //Remains on current line
22. The string escape sequence to insert a vertical tab in JavaScript
v
confirm()
document.getElementById("textAreaId").value = "Text Value";
window.location()
23. 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)
toPrecision(precision)
var stringVar = prompt("Text Here")
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
24. Math object method used to return the lowest value for a set of supplied numbers
\
'
string
Math.min(var1, var2, varN)
25. To alter the value of the text element in a span tag
document.getElementById("spanId").firstChild.nodeValue = "New Value";
event handler .
Math.abs(number)
document.getElementById("listId").value;
26. To get the text value of the control for radio buttons
var arrayVar = new Array()
document.getElementById("radioButtonId").value;
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
Charset
27. To make the browser load a new page using JavaScript
var answerVar = confirm("Message Text Here")
(Condition_Expression) ? Value_If_True : Value_If_False;
window.location = "New Web Address Here";
<script type="text/javascript">.....</script>
28. To assign actions to the window onLoad event
<script type="text/javascript">.....</script>
var stringVar = "part 1:" + "part 2";
window.onload = function() {//actions here}
for (counter; condition; incrementor) {}
29. Math object method used to return a given number raised to a given power
event handler .
(Condition_Expression) ? Value_If_True : Value_If_False;
toPrecision(precision)
Math.pow(number, power)
30. To get the value or the currently selected item for lists
Underscores
f
document.getElementById("listId").value;
Math.abs(number)
31. To set the digit precision of a decimal number
Number.NEGATIVE_INFINITY
toFixed(digitCount)
toFixed(digits)
toString(base)
32. To write a line to the current element of the DOM (Document Object Model)
document.writeln("Text Here") //Advances to new line after text
string
document.write("Text Here") //Remains on current line
Math.floor(number)
33. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
Objects
document.getElementById("TextBoxId").value;
var stringVar = prompt("Text Here")
charAt(position)
34. Date object method used to return a string containing the time
<noscript>
toTimeString()
toDateString()
document.getElementById("TextBoxId").disabled = true;
35. To view the current web address using JavaScript
<noscript>
document.getElementById("textAreaId").value = "Text Value";
window.location()
var arrayVar = new Array()
36. String object method used to get the character at a specified index position
charAt(position)
Two forward slashes "//"
confirm()
substring(startIndex)
37. To access the text element in a <span> tag
Underscores
document.getElementById("spanId").firstChild;
<script type="text/javascript">.....</script>
toString()
38. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
<noscript>
toFixed(digits)
document.getElementById("TextBoxId").disabled = true;
toPrecision(precision)
39. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
toPrecision(precision)
confirm("Message Text Here")
Number.NEGATIVE_INFINITY
Src - e.g. <script src="fileName.js"> //
40. JavaScript is case _______
sensitive
setMilliseconds()
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
Math.floor(number)
41. Math object method used to return the highest value from a set of supplied numbers
toLowerCase()
Math.max(var1, var2, varN)
document.getElementById("radioButtonId").checked;
prompt("Text Here")
42. To set the control to be disabled for textboxes
document.getElementById("TextBoxId").disabled = true;
Math.random() //Returns a value >= 0.0 but <1.0
\
Charset
43. The string escape sequence to start a new line in JavaScript
var dateObject = new Date("11/22/2012 18:25:35")
n
Src - e.g. <script src="fileName.js"> //
Math.max(var1, var2, varN)
44. The format to create a new Date object from a string
Math.ceil(number)
var functionName = function(param1, param2, paramN) {}
alert("Alert Text Here")
var dateObject = new Date("11/22/2012 18:25:35")
45. The string escape sequence to insert a double quote in JavaScript
"
Math.ceil(number)
document.getElementById("radioButtonId").value;
standard equality operators
46. A statement that yields a value
v
expression
document.getElementById("radioButtonId").checked = true; //Could also be false
redeclare
47. To denote a string in JavaScript
sensitive
document.getElementById("textAreaId").value;
Either single or double quotes surrounding the data
document.getElementById("CheckboxId").checked = true; //Could also be false
48. To code an If statement in JavaScript
var functionName = function(param1, param2, paramN) {}
if (condition) {}
toString(base)
Math.random() //Returns a value >= 0.0 but <1.0
49. The syntax of a conditional operator
var functionName = function(param1, param2, paramN) {}
toFixed(digitCount)
if (condition) {}
(Condition_Expression) ? Value_If_True : Value_If_False;
50. To get the text value of the control for radio buttons
window.onload = function() {//actions here}
document.getElementById("checkboxId").value;
focus
charAt(position)