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