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. Math object method used to return a given number that has been rounded to the closes integer value
document.getElementById("TextBoxId").value;
focus
Math.round(number)
var functionName = function(param1, param2, paramN) {}
2. A statement that yields a value
expression
confirm("Message Text Here")
\
document.getElementById("TextBoxId").disabled = true;
3. To set focus on the control for textboxes
getFullYear()
"
\
document.getElementById("TextBoxId").focus;
4. String object method used to get the character at a specified index position
window.onload = function() {//actions here}
charAt(position)
document.write("Text Here") //Remains on current line
===
5. Number object method used to return a number in exponential format with the specified number of decimal places
toExponential(digits)
toFixed(digitCount)
document.getElementById("ButtonId").onclick = functionName;
<noscript>
6. To create a single line comment in JavaScript
toDateString()
confirm()
charAt(position)
Two forward slashes "//"
7. To assign the return value of confirm() to a variable
toExponential(digits)
n
concat(var1, var2, varN)
var answerVar = confirm("Message Text Here")
8. To set the current checked status of the control for radio buttons
document.getElementById("radioButtonId").checked = true; //Could also be false
toString()
isNaN(varHere) //Returns true or false.
toDateString()
9. JavaScript is case _______
document.getElementById("TextBoxId").focus;
Multi line
sensitive
!==
10. To alter the value of the text element in a span tag
isNaN(varHere) //Returns true or false.
document.getElementById("spanId").firstChild.nodeValue = "New Value";
document.writeln("Text Here") //Advances to new line after text
v
11. Math object method used to return the square root of a given number
!==
r
Math.sqrt(number)
redeclare
12. Date object method used to return a string containing the date and time
window.location = "New Web Address Here";
toString()
toDateString()
substring(startIndex, stopIndex)
13. To access the text element in a <span> tag
document.getElementById("spanId").firstChild;
var dateObject = new Date("11/22/2012 18:25:35")
focus
string
14. To set the current checked status of the control for checkboxes
charAt(position)
prompt("Text Here")
standard equality operators
document.getElementById("CheckboxId").checked = true; //Could also be false
15. To display a confirmation
document.getElementById("checkboxId").checked;
confirm("Message Text Here")
Objects
\
16. 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
17. String object method used to return a new string that contains part of the original string from the specified start position
var functionName = function(param1, param2, paramN) {}
(Condition_Expression) ? Value_If_True : Value_If_False;
substring(startIndex)
var functionName = function(param1, param2, paramN) {}
18. To assign the value from a prompt to a non-string variable
document.getElementById("TextBoxId").value;
substring(startIndex)
n
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
19. The string escape sequence to insert a tab in JavaScript
sensitive
<noscript>
t
Two forward slashes "//"
20. String object method used to return the position of the first instance of a specified search string starting from the specified index
Math.sqrt(number)
indexOf(searchValue, startPosition)
document.getElementById("radioButtonId").checked = true; //Could also be false
toString(base)
21. To code a for statement in JavaScript
toString()
(Condition_Expression) ? Value_If_True : Value_If_False;
document.getElementById("TextBoxId").focus;
for (counter; condition; incrementor) {}
22. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
Math.round(number)
window.onload = function() {//actions here}
toFixed(digits)
getFullYear()
23. Date object method used to return a string containing the date
toDateString()
document.getElementById("spanId").firstChild;
Math.abs(number)
toExponential(digits)
24. What String object method returns a new string containing the value of the original string but in all lower case
toPrecision(precision)
toUpperCase()
r
toLowerCase()
25. The string escape sequence to insert a vertical tab in JavaScript
v
toExponential(digits)
\
var functionName = function(param1, param2, paramN) {}
26. Math object method used to return a given number raised to a given power
Math.pow(number, power)
substring(startIndex)
document.getElementById("TextBoxId").value;
var functionName = function(param1, param2, paramN) {}
27. To get the current checked status of the control for checkboxes
document.getElementById("spanId").firstChild;
Math.abs(number)
Multi line
document.getElementById("checkboxId").checked;
28. To denote a string in JavaScript
toDateString()
Objects
confirm("Message Text Here")
Either single or double quotes surrounding the data
29. The string escape sequence to start a new line in JavaScript
toExponential(digits)
n
Use the second parameter. Example: prompt("Enter Age:", "18")
Number.NEGATIVE_INFINITY
30. When you add a string and a number the result will be a ____
Math.max(var1, var2, varN)
string
toFixed(digits)
window.location()
31. To get the current value for textboxes
"
string
Math.ceil(number)
document.getElementById("TextBoxId").value;
32. To assign a default value to a prompt
confirm()
===
(Condition_Expression) ? Value_If_True : Value_If_False;
Use the second parameter. Example: prompt("Enter Age:", "18")
33. To make the browser load a new page using JavaScript
focus
Underscores
window.location = "New Web Address Here";
document.writeln("Text Here") //Advances to new line after text
34. A _______ variable can be changed and accessed from within and without a function or object.
!==
toFixed(digitCount)
global
Math.pow(number, power)
35. Command to display a prompt
toTimeString()
Objects
prompt("Text Here")
document.getElementById("ButtonId").onclick = functionName;
36. To insert Javascript into a web page
toDateString()
<script type="text/javascript">.....</script>
alert("Alert Text Here")
document.getElementById("CheckboxId").checked = true; //Could also be false
37. The string escape sequence to insert a carriage return in JavaScript
<script type="text/javascript">.....</script>
isNaN(varHere) //Returns true or false.
Math.min(var1, var2, varN)
r
38. The string escape sequence to insert a backslash in JavaScript
Math.round(number)
\
\
document.getElementById("radioButtonId").checked = true; //Could also be false
39. The syntax of a conditional operator
document.getElementById("checkboxId").value;
(Condition_Expression) ? Value_If_True : Value_If_False;
var stringVar = prompt("Text Here")
Math.min(var1, var2, varN)
40. Unlike ________________ identity operators do not perform type coercion.
standard equality operators
toUpperCase()
toString(base)
document.getElementById("textAreaId").value = "Text Value";
41. The four attributes of the <script> tag:Type - Src - _____ and Defer
focus
Charset
document.getElementById("TextBoxId").disabled = true;
Math.sqrt(number)
42. To get the current checked status of the control for radio buttons
getTime()
document.getElementById("radioButtonId").checked;
charAt(position)
confirm()
43. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
document.write("Text Here") //Remains on current line
toPrecision(precision)
getTime()
<noscript>
44. To set the current value of the control for a text area
getFullYear()
Math.min(var1, var2, varN)
confirm()
document.getElementById("textAreaId").value = "Text Value";
45. Math object method used to return a random number
Math.random() //Returns a value >= 0.0 but <1.0
toLowerCase()
getFullYear()
var variableName;
46. The string escape sequence to insert a form feed in JavaScript
udddd
f
var variableName;
Multi line
47. Number object method used to round numbers to the specified number of decimal places
Math.min(var1, var2, varN)
if (condition) {}
isNaN(varHere) //Returns true or false.
toFixed(digits)
48. This returns only True or false values
if (condition) {}
document.getElementById("spanId").firstChild.nodeValue = "New Value";
Math.max(var1, var2, varN)
confirm()
49. To write a line to the current element of the DOM (Document Object Model)
document.getElementById("ButtonId").onclick = functionName;
Math.abs(number)
!==
document.writeln("Text Here") //Advances to new line after text
50. Number object method used to return a string with a given number base
udddd
toString(base)
string
document.getElementById("spanId").firstChild;