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. String object method used to return the position of the first instance of a specified search string starting from the specified index
toExponential(digits)
indexOf(searchValue, startPosition)
v
Math.random() //Returns a value >= 0.0 but <1.0
2. Math object method used to return a given number rounded to the next lowest integer value
Math.floor(number)
f
toFixed(digits)
Math.sqrt(number)
3. The identity operator for equals
<script type="text/javascript">.....</script>
document.getElementById("CheckboxId").checked = true; //Could also be false
Src - e.g. <script src="fileName.js"> //
===
4. To declare a variable in JavaScript
alert("Alert Text Here")
setMilliseconds()
var variableName;
global
5. To write a line to the current element of the DOM (Document Object Model)
udddd
var stringVar = "part 1:" + "part 2";
window.location = "New Web Address Here";
document.writeln("Text Here") //Advances to new line after text
6. The string escape sequence to insert a backslash in JavaScript
global
substring(startIndex, stopIndex)
toUpperCase()
\
7. The four attributes of the <script> tag:Type - Src - _____ and Defer
Multi line
isNaN(varHere) //Returns true or false.
Either single or double quotes surrounding the data
Charset
8. Math object method used to return a given number rounded to the next highest integer value
toDateString()
expression
Math.ceil(number)
window.onload = function() {//actions here}
9. Statements end in JavaScript with a ________
indexOf(searchValue, startPosition)
semicolon ";"
isNaN(varHere) //Returns true or false.
document.getElementById("TextBoxId").disabled = true;
10. To set the current checked status of the control for radio buttons
n
document.getElementById("radioButtonId").checked = true; //Could also be false
document.getElementById(id)
Math.random() //Returns a value >= 0.0 but <1.0
11. Math object method used to return a given number raised to a given power
Two forward slashes "//"
Charset
Math.pow(number, power)
document.write("Text Here") //Remains on current line
12. To get the current checked status of the control for radio buttons
v
document.getElementById("radioButtonId").checked;
document.getElementById("textAreaId").value = "Text Value";
document.getElementById("radioButtonId").value;
13. What String object method returns a new string containing the value of the original string but in all lower case
toFixed(digitCount)
toTimeString()
toLowerCase()
document.getElementById("TextBoxId").focus;
14. To assign the value from a prompt to a non-string variable
Either single or double quotes surrounding the data
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
charAt(position)
r
15. To access the text element in a <span> tag
f
var functionName = function(param1, param2, paramN) {}
toString(base)
document.getElementById("spanId").firstChild;
16. The identity operator for not equal
document.getElementById("textAreaId").value;
Math.max(var1, var2, varN)
global
!==
17. Command to display a prompt
<script type="text/javascript">.....</script>
var variableName;
(Condition_Expression) ? Value_If_True : Value_If_False;
prompt("Text Here")
18. The string escape sequence to insert a double quote in JavaScript
document.getElementById("textAreaId").value = "Text Value";
"
toPrecision(precision)
substring(startIndex)
19. To create a function that returns a value in JavaScript
var functionName = function(param1, param2, paramN) {}
ondblclick
document.getElementById("spanId").firstChild.nodeValue = "New Value";
===
20. To code a for statement in JavaScript
Underscores
redeclare
for (counter; condition; incrementor) {}
Math.floor(number)
21. Number object method used to return a string with a given number base
string
Math.round(number)
toString(base)
Math.min(var1, var2, varN)
22. Number object method used to round numbers to the specified number of decimal places
toFixed(digits)
n
document.getElementById("listId").value;
Use the second parameter. Example: prompt("Enter Age:", "18")
23. Number object method used to return a numerical string with the specified number of significant digits
document.getElementById("TextBoxId").focus;
document.getElementById("TextBoxId").value;
window.onload = function() {//actions here}
toPrecision(precision)
24. To create a new Date object
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
document.getElementById("CheckboxId").checked = true; //Could also be false
document.getElementById("spanId").firstChild.nodeValue = "New Value";
window.onload = function() {//actions here}
25. Date object method used to return a string containing the time
focus
document.getElementById("spanId").firstChild.nodeValue = "New Value";
toTimeString()
"
26. To code a button.onclick event handler
document.getElementById("ButtonId").onclick = functionName;
===
sensitive
Math.floor(number)
27. To assign actions to the window onLoad event
toLowerCase()
getTime()
toExponential(digits)
window.onload = function() {//actions here}
28. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
Use the second parameter. Example: prompt("Enter Age:", "18")
Number.NEGATIVE_INFINITY
toExponential(digits)
expression
29. What Date object method is used to return the number of milliseconds since the start of GMT
getTime()
toUpperCase()
document.getElementById("textAreaId").value = "Text Value";
Math.pow(number, power)
30. To get the current value of the control for a text area
if (condition) {}
var arrayVar = new Array()
getFullYear()
document.getElementById("textAreaId").value;
31. Date object method used to return a string containing the date
window.location()
document.getElementById("TextBoxId").value;
v
toDateString()
32. String object method used to return a new string that contains part of the original string from the specified start position
substring(startIndex, stopIndex)
while (condition) {}
substring(startIndex)
toUpperCase()
33. The string escape sequence to insert a single quote in JavaScript
34. The format to create a new Date object from a string
document.getElementById("listId").value;
confirm()
document.getElementById("CheckboxId").checked = true; //Could also be false
var dateObject = new Date("11/22/2012 18:25:35")
35. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
document.writeln("Text Here") //Advances to new line after text
var dateVar = new Date()
var stringVar = prompt("Text Here")
getFullYear()
36. To create an Array object in JavaScript
sensitive
Charset
document.getElementById("checkboxId").value;
var arrayVar = new Array()
37. Number object method used to return a number in exponential format with the specified number of decimal places
Two forward slashes "//"
Use the second parameter. Example: prompt("Enter Age:", "18")
isNaN(varHere) //Returns true or false.
toExponential(digits)
38. Unlike ________________ identity operators do not perform type coercion.
string
<noscript>
toDateString()
standard equality operators
39. To get the text value of the control for radio buttons
redeclare
Math.abs(number)
Math.floor(number)
document.getElementById("radioButtonId").value;
40. The escape sequence used to insert a Unicode character into a string in JavaScript
toExponential(digits)
redeclare
while (condition) {}
udddd
41. To get the text value of the control for radio buttons
document.getElementById("checkboxId").value;
===
document.getElementById("radioButtonId").value;
document.getElementById("spanId").firstChild;
42. Date object method used to return a string containing the date and time
alert("Alert Text Here")
Either single or double quotes surrounding the data
n
toString()
43. To create a single line comment in JavaScript
document.getElementById("spanId").firstChild.nodeValue = "New Value";
getTime()
var stringVar = "part 1:" + "part 2";
Two forward slashes "//"
44. To set the current checked status of the control for checkboxes
r
document.getElementById("CheckboxId").checked = true; //Could also be false
expression
\
45. To access a page element by id
document.getElementById(id)
toLowerCase()
v
Math.sqrt(number)
46. What String object method returns a new string containing the value of the original string but in all upper case
toUpperCase()
while (condition) {}
if (condition) {}
Math.pow(number, power)
47. To denote a string in JavaScript
toDateString()
document.getElementById("spanId").firstChild.nodeValue = "New Value";
substring(startIndex)
Either single or double quotes surrounding the data
48. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
Objects
confirm("Message Text Here")
toPrecision(precision)
var stringVar = prompt("Text Here")
49. String object method used to concatenate multiple strings
!==
toLowerCase()
concat(var1, var2, varN)
document.getElementById("CheckboxId").checked = true; //Could also be false
50. The string escape sequence to insert a tab in JavaScript
toDateString()
t
toFixed(digits)
document.getElementById("listId").value;