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 denote a string in JavaScript
Either single or double quotes surrounding the data
r
document.getElementById("checkboxId").value;
window.onload = function() {//actions here}
2. To set the current value of the control for a text area
if (condition) {}
document.getElementById("textAreaId").value = "Text Value";
document.getElementById("radioButtonId").checked = true; //Could also be false
Math.round(number)
3. To get the value or the currently selected item for lists
document.getElementById("textAreaId").value;
Math.min(var1, var2, varN)
Math.pow(number, power)
document.getElementById("listId").value;
4. To get the current checked status of the control for checkboxes
toUpperCase()
Either single or double quotes surrounding the data
var dateVar = new Date()
document.getElementById("checkboxId").checked;
5. Math object method used to return the absolute value of a given number
Math.abs(number)
(Condition_Expression) ? Value_If_True : Value_If_False;
document.getElementById("listId").value;
var dateVar = new Date()
6. To get the current value of the control for a text area
string
n
document.getElementById("textAreaId").value;
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
7. Math object method used to return the highest value from a set of supplied numbers
Math.max(var1, var2, varN)
(Condition_Expression) ? Value_If_True : Value_If_False;
expression
toUpperCase()
8. When you add a string and a number the result will be a ____
string
var functionName = function(param1, param2, paramN) {}
<noscript>
redeclare
9. To set the control to be disabled for textboxes
redeclare
document.getElementById("TextBoxId").disabled = true;
alert("Alert Text Here")
Use the second parameter. Example: prompt("Enter Age:", "18")
10. To access the text element in a <span> tag
(Condition_Expression) ? Value_If_True : Value_If_False;
document.getElementById("spanId").firstChild;
n
substring(startIndex)
11. To get the text value of the control for radio buttons
document.getElementById("radioButtonId").value;
alert("Alert Text Here")
var variableName;
while (condition) {}
12. To assign the return value of confirm() to a variable
(Condition_Expression) ? Value_If_True : Value_If_False;
var dateVar = new Date()
udddd
var answerVar = confirm("Message Text Here")
13. Date object method used to return a string containing the date and time
document.getElementById("radioButtonId").checked = true; //Could also be false
toString()
toPrecision(precision)
if (condition) {}
14. 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
Either single or double quotes surrounding the data
substring(startIndex, stopIndex)
isNaN(varHere) //Returns true or false.
getTime()
15. To declare a variable in JavaScript
ondblclick
var variableName;
document.getElementById("radioButtonId").value;
concat(var1, var2, varN)
16. To concatenate multiple parts into a string
Use the second parameter. Example: prompt("Enter Age:", "18")
udddd
var stringVar = "part 1:" + "part 2";
Multi line
17. Math object method used to return a given number that has been rounded to the closes integer value
document.getElementById("listId").value;
Math.round(number)
var functionName = function(param1, param2, paramN) {}
v
18. The string escape sequence to insert a tab in JavaScript
document.getElementById("checkboxId").checked;
toString()
t
getTime()
19. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
window.location = "New Web Address Here";
toFixed(digitCount)
focus
'
20. Command to display a prompt
prompt("Text Here")
document.write("Text Here") //Remains on current line
'
document.getElementById("TextBoxId").value;
21. Number object method used to return a number in exponential format with the specified number of decimal places
toExponential(digits)
toDateString()
document.getElementById("TextBoxId").value;
window.onload = function() {//actions here}
22. To set the current checked status of the control for radio buttons
===
document.getElementById("textAreaId").value;
n
document.getElementById("radioButtonId").checked = true; //Could also be false
23. To view the current web address using JavaScript
window.location()
toString(base)
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
substring(startIndex)
24. The identity operator for not equal
!==
document.getElementById("CheckboxId").checked = true; //Could also be false
window.location()
concat(var1, var2, varN)
25. When you __________ a javascript variable it retains its original value
redeclare
\
expression
focus
26. To write a line to the current element of the DOM (Document Object Model)
document.writeln("Text Here") //Advances to new line after text
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
window.location = "New Web Address Here";
substring(startIndex)
27. What Date object method is used to return the number of milliseconds since the start of GMT
redeclare
var dateVar = new Date()
document.getElementById("spanId").firstChild.nodeValue = "New Value";
getTime()
28. To get the current value for textboxes
document.getElementById("TextBoxId").value;
Math.max(var1, var2, varN)
toExponential(digits)
t
29. To assign a default value to a prompt
(Condition_Expression) ? Value_If_True : Value_If_False;
document.getElementById(id)
Math.random() //Returns a value >= 0.0 but <1.0
Use the second parameter. Example: prompt("Enter Age:", "18")
30. To assign the value from a prompt to a non-string variable
toExponential(digits)
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Math.floor(number)
Math.min(var1, var2, varN)
31. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
confirm()
document.getElementById("textAreaId").value = "Text Value";
Number.NEGATIVE_INFINITY
document.getElementById("radioButtonId").checked;
32. A statement that yields a value
expression
f
Two forward slashes "//"
window.location()
33. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
alert("Alert Text Here")
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Underscores
Objects
34. To write text to the current element of the DOM
<noscript>
var arrayVar = new Array()
prompt("Text Here")
document.write("Text Here") //Remains on current line
35. To display an alert
Two forward slashes "//"
alert("Alert Text Here")
prompt("Text Here")
confirm("Message Text Here")
36. To code a for statement in JavaScript
toDateString()
toFixed(digits)
toString()
for (counter; condition; incrementor) {}
37. To get the text value of the control for radio buttons
Math.round(number)
document.getElementById("checkboxId").value;
alert("Alert Text Here")
Charset
38. Math object method used to return the lowest value for a set of supplied numbers
!==
Math.min(var1, var2, varN)
v
document.getElementById("TextBoxId").disabled = true;
39. 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
40. To assign the value from a prompt to a string
Two forward slashes "//"
var stringVar = prompt("Text Here")
Math.max(var1, var2, varN)
udddd
41. To make the browser load a new page using JavaScript
window.location = "New Web Address Here";
ondblclick
\
confirm()
42. The string escape sequence to insert a carriage return in JavaScript
ondblclick
global
r
document.getElementById("TextBoxId").value;
43. Number object method used to return a string with a given number base
toTimeString()
toString(base)
getTime()
confirm()
44. The string escape sequence to insert a double quote in JavaScript
expression
"
var functionName = function(param1, param2, paramN) {}
document.getElementById("checkboxId").value;
45. To assign actions to the window onLoad event
window.onload = function() {//actions here}
concat(var1, var2, varN)
redeclare
var stringVar = "part 1:" + "part 2";
46. To display a confirmation
confirm("Message Text Here")
'
toDateString()
<script type="text/javascript">.....</script>
47. To create a Date object in JavaScript
global
var dateVar = new Date()
t
window.location()
48. To create a single line comment in JavaScript
Two forward slashes "//"
toExponential(digits)
Math.pow(number, power)
n
49. A _______ variable can be changed and accessed from within and without a function or object.
window.onload = function() {//actions here}
for (counter; condition; incrementor) {}
Underscores
global
50. What String object method returns a new string containing the value of the original string but in all lower case
expression
confirm()
toLowerCase()
var stringVar = prompt("Text Here")