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 concatenate multiple parts into a string
concat(var1, var2, varN)
document.getElementById(id)
var stringVar = "part 1:" + "part 2";
Math.random() //Returns a value >= 0.0 but <1.0
2. To code a while statement in JavaScript
Math.floor(number)
semicolon ";"
t
while (condition) {}
3. Math object method used to return a given number that has been rounded to the closes integer value
ondblclick
substring(startIndex)
Math.round(number)
udddd
4. To set focus on the control for textboxes
toLowerCase()
document.getElementById("TextBoxId").focus;
Multi line
toString(base)
5. Math object method used to return a random number
sensitive
(Condition_Expression) ? Value_If_True : Value_If_False;
Math.sqrt(number)
Math.random() //Returns a value >= 0.0 but <1.0
6. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
event handler .
Math.max(var1, var2, varN)
Multi line
Math.abs(number)
7. The string escape sequence to insert a form feed in JavaScript
f
sensitive
"
(Condition_Expression) ? Value_If_True : Value_If_False;
8. JavaScript is case _______
sensitive
<noscript>
document.getElementById("spanId").firstChild;
expression
9. Number object method used to return a numerical string with the specified number of significant digits
if (condition) {}
for (counter; condition; incrementor) {}
toPrecision(precision)
alert("Alert Text Here")
10. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
Objects
Either single or double quotes surrounding the data
document.getElementById("ButtonId").onclick = functionName;
indexOf(searchValue, startPosition)
11. Math object method used to return a given number rounded to the next lowest integer value
toUpperCase()
Use the second parameter. Example: prompt("Enter Age:", "18")
Math.floor(number)
Objects
12. To set the current checked status of the control for checkboxes
document.getElementById("CheckboxId").checked = true; //Could also be false
"
toFixed(digits)
Two forward slashes "//"
13. ________ comments start with / and end with /.
indexOf(searchValue, startPosition)
Multi line
document.getElementById("checkboxId").value;
string
14. To create a function in JavaScript
var functionName = function(param1, param2, paramN) {}
toTimeString()
\
Number.NEGATIVE_INFINITY
15. 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
Math.random() //Returns a value >= 0.0 but <1.0
substring(startIndex, stopIndex)
"
Src - e.g. <script src="fileName.js"> //
16. To write a line to the current element of the DOM (Document Object Model)
<script type="text/javascript">.....</script>
standard equality operators
document.writeln("Text Here") //Advances to new line after text
document.getElementById(id)
17. The string escape sequence to insert a double quote in JavaScript
Number.NEGATIVE_INFINITY
isNaN(varHere) //Returns true or false.
"
===
18. To access a page element by id
Math.floor(number)
document.getElementById(id)
Either single or double quotes surrounding the data
Src - e.g. <script src="fileName.js"> //
19. 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
20. The _____ attribute is used to denote external file for script use
\
Math.round(number)
Src - e.g. <script src="fileName.js"> //
toFixed(digitCount)
21. To assign the value from a prompt to a string
var stringVar = prompt("Text Here")
document.getElementById("listId").value;
if (condition) {}
indexOf(searchValue, startPosition)
22. To make the browser load a new page using JavaScript
t
document.getElementById("TextBoxId").value;
window.location = "New Web Address Here";
Underscores
23. The string escape sequence to insert a vertical tab in JavaScript
!==
document.getElementById("TextBoxId").focus;
document.getElementById("spanId").firstChild;
v
24. To alter the value of the text element in a span tag
document.getElementById("spanId").firstChild.nodeValue = "New Value";
Either single or double quotes surrounding the data
isNaN(varHere) //Returns true or false.
===
25. To create a Date object in JavaScript
Charset
document.writeln("Text Here") //Advances to new line after text
Math.min(var1, var2, varN)
var dateVar = new Date()
26. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
sensitive
Objects
Number.NEGATIVE_INFINITY
Math.abs(number)
27. The identity operator for equals
===
Math.floor(number)
window.onload = function() {//actions here}
var variableName;
28. Math object method used to return the lowest value for a set of supplied numbers
var dateVar = new Date()
Math.min(var1, var2, varN)
document.getElementById("ButtonId").onclick = functionName;
var stringVar = "part 1:" + "part 2";
29. To code a button.onclick event handler
Math.sqrt(number)
n
document.getElementById("ButtonId").onclick = functionName;
substring(startIndex, stopIndex)
30. Math object method used to return the highest value from a set of supplied numbers
toFixed(digits)
redeclare
Multi line
Math.max(var1, var2, varN)
31. To get the value or the currently selected item for lists
udddd
document.getElementById("checkboxId").value;
document.getElementById("listId").value;
Math.pow(number, power)
32. To get the current checked status of the control for checkboxes
document.getElementById("checkboxId").checked;
Objects
setMilliseconds()
getFullYear()
33. To get the current checked status of the control for radio buttons
document.getElementById("radioButtonId").checked;
global
getTime()
expression
34. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
Underscores
toPrecision(precision)
Use the second parameter. Example: prompt("Enter Age:", "18")
window.onload = function() {//actions here}
35. When you add a string and a number the result will be a ____
toFixed(digits)
global
string
t
36. What String object method returns a new string containing the value of the original string but in all upper case
toUpperCase()
prompt("Text Here")
Number.NEGATIVE_INFINITY
sensitive
37. The four attributes of the <script> tag:Type - Src - _____ and Defer
for (counter; condition; incrementor) {}
Math.min(var1, var2, varN)
getFullYear()
Charset
38. Date object method used to return a string containing the time
<script type="text/javascript">.....</script>
toPrecision(precision)
toTimeString()
var arrayVar = new Array()
39. To denote a string in JavaScript
toFixed(digitCount)
(Condition_Expression) ? Value_If_True : Value_If_False;
for (counter; condition; incrementor) {}
Either single or double quotes surrounding the data
40. To test that a variable contains a valid number
var arrayVar = new Array()
isNaN(varHere) //Returns true or false.
document.getElementById("textAreaId").value = "Text Value";
Math.min(var1, var2, varN)
41. A _______ variable can be changed and accessed from within and without a function or object.
n
substring(startIndex, stopIndex)
getTime()
global
42. To access the text element in a <span> tag
Underscores
document.writeln("Text Here") //Advances to new line after text
substring(startIndex)
document.getElementById("spanId").firstChild;
43. Math object method used to return a given number raised to a given power
<script type="text/javascript">.....</script>
document.write("Text Here") //Remains on current line
Math.pow(number, power)
Objects
44. To get the text value of the control for radio buttons
Math.round(number)
document.getElementById("radioButtonId").value;
ondblclick
document.getElementById("textAreaId").value = "Text Value";
45. To create an Array object in JavaScript
"
toExponential(digits)
var arrayVar = new Array()
(Condition_Expression) ? Value_If_True : Value_If_False;
46. To get the text value of the control for radio buttons
sensitive
document.getElementById("checkboxId").value;
document.getElementById(id)
window.location()
47. To assign the value from a prompt to a non-string variable
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
var variableName;
toFixed(digitCount)
Math.pow(number, power)
48. The string escape sequence to insert a backslash in JavaScript
document.getElementById("spanId").firstChild;
indexOf(searchValue, startPosition)
\
toFixed(digits)
49. To set the current value of the control for a text area
document.getElementById("textAreaId").value = "Text Value";
var functionName = function(param1, param2, paramN) {}
Math.min(var1, var2, varN)
Math.round(number)
50. Unlike ________________ identity operators do not perform type coercion.
concat(var1, var2, varN)
n
standard equality operators
getTime()