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. Number object method used to return a numerical string with the specified number of significant digits
toPrecision(precision)
document.getElementById("textAreaId").value;
document.getElementById("radioButtonId").checked;
document.getElementById(id)
2. To code a button.onclick event handler
Math.abs(number)
document.getElementById("ButtonId").onclick = functionName;
alert("Alert Text Here")
sensitive
3. To test that a variable contains a valid number
isNaN(varHere) //Returns true or false.
document.getElementById("radioButtonId").checked;
getFullYear()
f
4. A _______ variable can be changed and accessed from within and without a function or object.
document.getElementById("spanId").firstChild.nodeValue = "New Value";
global
Math.ceil(number)
confirm()
5. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
Number.NEGATIVE_INFINITY
'
Math.pow(number, power)
6. The format to create a new Date object from a string
Math.floor(number)
var dateObject = new Date("11/22/2012 18:25:35")
indexOf(searchValue, startPosition)
\
7. When you __________ a javascript variable it retains its original value
toDateString()
Math.abs(number)
<noscript>
redeclare
8. To denote a string in JavaScript
toString(base)
var functionName = function(param1, param2, paramN) {}
event handler .
Either single or double quotes surrounding the data
9. To get the text value of the control for radio buttons
document.getElementById("textAreaId").value = "Text Value";
var arrayVar = new Array()
getFullYear()
document.getElementById("radioButtonId").value;
10. The string escape sequence to start a new line in JavaScript
Multi line
document.getElementById("textAreaId").value;
toExponential(digits)
n
11. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
var variableName;
toDateString()
Underscores
redeclare
12. The four attributes of the <script> tag:Type - Src - _____ and Defer
Math.pow(number, power)
Charset
Math.sqrt(number)
charAt(position)
13. To create a single line comment in JavaScript
redeclare
Two forward slashes "//"
===
\
14. The string escape sequence to insert a form feed in JavaScript
Number.NEGATIVE_INFINITY
document.getElementById("TextBoxId").value;
document.getElementById("checkboxId").value;
f
15. To get the current checked status of the control for checkboxes
r
var answerVar = confirm("Message Text Here")
document.getElementById("checkboxId").checked;
var dateObject = new Date("11/22/2012 18:25:35")
16. Date object method used to return a string containing the date and time
substring(startIndex)
toString()
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
getTime()
17. The syntax of a conditional operator
<script type="text/javascript">.....</script>
(Condition_Expression) ? Value_If_True : Value_If_False;
v
var stringVar = prompt("Text Here")
18. When you add a string and a number the result will be a ____
toFixed(digitCount)
'
var functionName = function(param1, param2, paramN) {}
string
19. To create a function that returns a value in JavaScript
f
semicolon ";"
var functionName = function(param1, param2, paramN) {}
toString(base)
20. Math object method used to return a given number raised to a given power
Math.pow(number, power)
toExponential(digits)
Use the second parameter. Example: prompt("Enter Age:", "18")
document.getElementById("spanId").firstChild.nodeValue = "New Value";
21. To declare a variable in JavaScript
var variableName;
semicolon ";"
Math.min(var1, var2, varN)
Objects
22. To get the text value of the control for radio buttons
toLowerCase()
window.location()
document.getElementById("checkboxId").value;
n
23. Date object method used to return a string containing the time
===
window.location = "New Web Address Here";
document.write("Text Here") //Remains on current line
toTimeString()
24. To set the digit precision of a decimal number
var functionName = function(param1, param2, paramN) {}
toFixed(digitCount)
v
for (counter; condition; incrementor) {}
25. To alter the value of the text element in a span tag
toFixed(digitCount)
document.getElementById("spanId").firstChild.nodeValue = "New Value";
!==
global
26. Math object method used to return a given number rounded to the next highest integer value
Math.ceil(number)
t
focus
toLowerCase()
27. To assign the value from a prompt to a non-string variable
ondblclick
confirm()
alert("Alert Text Here")
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
28. ________ comments start with / and end with /.
Multi line
document.getElementById("spanId").firstChild;
document.write("Text Here") //Remains on current line
string
29. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
Either single or double quotes surrounding the data
confirm("Message Text Here")
udddd
focus
30. To get the current checked status of the control for radio buttons
document.getElementById("radioButtonId").checked;
charAt(position)
Use the second parameter. Example: prompt("Enter Age:", "18")
document.writeln("Text Here") //Advances to new line after text
31. Command to display a prompt
var functionName = function(param1, param2, paramN) {}
prompt("Text Here")
getTime()
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
32. To code a while statement in JavaScript
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
document.getElementById("checkboxId").checked;
while (condition) {}
substring(startIndex, stopIndex)
33. String object method used to return the position of the first instance of a specified search string starting from the specified index
Either single or double quotes surrounding the data
Src - e.g. <script src="fileName.js"> //
indexOf(searchValue, startPosition)
n
34. The events common to most controls: onfocus - onblur - onclick - _______ - onchange - onselect
Math.pow(number, power)
ondblclick
toUpperCase()
getTime()
35. To display an alert
alert("Alert Text Here")
document.getElementById("listId").value;
document.getElementById("checkboxId").value;
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
36. Math object method used to return the square root of a given number
semicolon ";"
Math.floor(number)
n
Math.sqrt(number)
37. To write a line to the current element of the DOM (Document Object Model)
<script type="text/javascript">.....</script>
document.getElementById("TextBoxId").value;
document.writeln("Text Here") //Advances to new line after text
prompt("Text Here")
38. To set the control to be disabled for textboxes
toString(base)
document.getElementById("TextBoxId").disabled = true;
Math.abs(number)
toUpperCase()
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. Unlike ________________ identity operators do not perform type coercion.
<script type="text/javascript">.....</script>
standard equality operators
r
Math.round(number)
41. The identity operator for equals
Math.floor(number)
getTime()
document.getElementById("ButtonId").onclick = functionName;
===
42. To assign a default value to a prompt
window.location()
Math.min(var1, var2, varN)
r
Use the second parameter. Example: prompt("Enter Age:", "18")
43. Math object method used to return a given number rounded to the next lowest integer value
Math.floor(number)
toTimeString()
n
(Condition_Expression) ? Value_If_True : Value_If_False;
44. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________
document.getElementById("textAreaId").value;
window.onload = function() {//actions here}
var dateObject = new Date("11/22/2012 18:25:35")
setMilliseconds()
45. Math object method used to return the highest value from a set of supplied numbers
substring(startIndex, stopIndex)
document.getElementById("checkboxId").value;
Multi line
Math.max(var1, var2, varN)
46. What String object method returns a new string containing the value of the original string but in all upper case
document.getElementById(id)
toUpperCase()
charAt(position)
toDateString()
47. Math object method used to return the absolute value of a given number
Math.abs(number)
isNaN(varHere) //Returns true or false.
n
toTimeString()
48. What String object method returns a new string containing the value of the original string but in all lower case
for (counter; condition; incrementor) {}
document.writeln("Text Here") //Advances to new line after text
var stringVar = "part 1:" + "part 2";
toLowerCase()
49. The escape sequence used to insert a Unicode character into a string in JavaScript
udddd
var arrayVar = new Array()
var functionName = function(param1, param2, paramN) {}
document.getElementById("spanId").firstChild;
50. To assign the return value of confirm() to a variable
Math.round(number)
document.getElementById("TextBoxId").disabled = true;
var stringVar = prompt("Text Here")
var answerVar = confirm("Message Text Here")