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 string with a given number base
document.getElementById("radioButtonId").checked;
udddd
toString(base)
Math.abs(number)
2. Date object method used to return a string containing the date
var variableName;
toDateString()
for (counter; condition; incrementor) {}
charAt(position)
3. To set the digit precision of a decimal number
semicolon ";"
window.onload = function() {//actions here}
var functionName = function(param1, param2, paramN) {}
toFixed(digitCount)
4. String object method used to return a new string that contains part of the original string from the specified start position
concat(var1, var2, varN)
substring(startIndex)
!==
Math.sqrt(number)
5. To get the current checked status of the control for radio buttons
document.getElementById(id)
toString(base)
document.getElementById("radioButtonId").checked;
concat(var1, var2, varN)
6. To concatenate multiple parts into a string
toLowerCase()
Either single or double quotes surrounding the data
document.getElementById("CheckboxId").checked = true; //Could also be false
var stringVar = "part 1:" + "part 2";
7. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
(Condition_Expression) ? Value_If_True : Value_If_False;
event handler .
var functionName = function(param1, param2, paramN) {}
redeclare
8. To make the browser load a new page using JavaScript
window.location = "New Web Address Here";
window.onload = function() {//actions here}
Math.max(var1, var2, varN)
document.getElementById("TextBoxId").value;
9. Math object method used to return a given number rounded to the next lowest integer value
Math.pow(number, power)
Math.floor(number)
udddd
t
10. Number object method used to round numbers to the specified number of decimal places
toFixed(digits)
var answerVar = confirm("Message Text Here")
semicolon ";"
var functionName = function(param1, param2, paramN) {}
11. To code a for statement in JavaScript
toExponential(digits)
Charset
for (counter; condition; incrementor) {}
prompt("Text Here")
12. To get the text value of the control for radio buttons
focus
getFullYear()
r
document.getElementById("checkboxId").value;
13. The format to create a new Date object from a string
t
<script type="text/javascript">.....</script>
var dateObject = new Date("11/22/2012 18:25:35")
var arrayVar = new Array()
14. To get the value or the currently selected item for lists
document.getElementById("radioButtonId").value;
!==
<noscript>
document.getElementById("listId").value;
15. ________ comments start with / and end with /.
toPrecision(precision)
document.getElementById("radioButtonId").checked = true; //Could also be false
Use the second parameter. Example: prompt("Enter Age:", "18")
Multi line
16. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
concat(var1, var2, varN)
<noscript>
Math.sqrt(number)
confirm("Message Text Here")
17. To assign actions to the window onLoad event
document.getElementById("textAreaId").value;
toExponential(digits)
getFullYear()
window.onload = function() {//actions here}
18. To create a Date object in JavaScript
isNaN(varHere) //Returns true or false.
if (condition) {}
var dateVar = new Date()
window.location()
19. To code a while statement in JavaScript
event handler .
document.getElementById("spanId").firstChild;
n
while (condition) {}
20. 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
21. To create a function that returns a value in JavaScript
var functionName = function(param1, param2, paramN) {}
focus
setMilliseconds()
Use the second parameter. Example: prompt("Enter Age:", "18")
22. To create a function in JavaScript
Charset
charAt(position)
var functionName = function(param1, param2, paramN) {}
document.getElementById("textAreaId").value;
23. Unlike ________________ identity operators do not perform type coercion.
r
var dateObject = new Date("11/22/2012 18:25:35")
toExponential(digits)
standard equality operators
24. To get the current value of the control for a text area
document.getElementById("textAreaId").value;
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
udddd
window.location = "New Web Address Here";
25. To write a line to the current element of the DOM (Document Object Model)
toTimeString()
document.writeln("Text Here") //Advances to new line after text
document.getElementById("checkboxId").value;
redeclare
26. Date object method used to return a string containing the time
Either single or double quotes surrounding the data
toTimeString()
toFixed(digits)
t
27. To assign the value from a prompt to a string
toTimeString()
var stringVar = prompt("Text Here")
t
alert("Alert Text Here")
28. Statements end in JavaScript with a ________
semicolon ";"
document.getElementById("spanId").firstChild.nodeValue = "New Value";
Math.random() //Returns a value >= 0.0 but <1.0
Math.max(var1, var2, varN)
29. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
setMilliseconds()
Multi line
Math.floor(number)
getFullYear()
30. To access the text element in a <span> tag
document.getElementById("spanId").firstChild;
toFixed(digits)
toString(base)
event handler .
31. The events common to most controls: onfocus - onblur - onclick - _______ - onchange - onselect
semicolon ";"
getTime()
ondblclick
global
32. To assign the value from a prompt to a non-string variable
confirm("Message Text Here")
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Charset
for (counter; condition; incrementor) {}
33. Math object method used to return a given number raised to a given power
var functionName = function(param1, param2, paramN) {}
Math.pow(number, power)
'
r
34. String object method used to concatenate multiple strings
window.onload = function() {//actions here}
document.getElementById("checkboxId").value;
concat(var1, var2, varN)
Either single or double quotes surrounding the data
35. The string escape sequence to insert a form feed in JavaScript
f
document.getElementById("TextBoxId").disabled = true;
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
charAt(position)
36. To access a page element by id
document.getElementById(id)
document.getElementById("textAreaId").value = "Text Value";
document.getElementById("checkboxId").checked;
redeclare
37. When you __________ a javascript variable it retains its original value
redeclare
window.location()
(Condition_Expression) ? Value_If_True : Value_If_False;
isNaN(varHere) //Returns true or false.
38. To get the text value of the control for radio buttons
\
Either single or double quotes surrounding the data
document.getElementById("radioButtonId").value;
!==
39. Math object method used to return the absolute value of a given number
Math.abs(number)
global
expression
t
40. A _______ variable can be changed and accessed from within and without a function or object.
toExponential(digits)
global
isNaN(varHere) //Returns true or false.
document.getElementById("radioButtonId").checked;
41. To alter the value of the text element in a span tag
redeclare
var functionName = function(param1, param2, paramN) {}
document.getElementById("spanId").firstChild.nodeValue = "New Value";
concat(var1, var2, varN)
42. This returns only True or false values
expression
toFixed(digitCount)
Number.NEGATIVE_INFINITY
confirm()
43. Math object method used to return a random number
document.getElementById(id)
Math.random() //Returns a value >= 0.0 but <1.0
prompt("Text Here")
Math.abs(number)
44. The identity operator for equals
Multi line
===
semicolon ";"
var stringVar = "part 1:" + "part 2";
45. To get the current checked status of the control for checkboxes
document.getElementById("checkboxId").checked;
indexOf(searchValue, startPosition)
toExponential(digits)
charAt(position)
46. To assign the return value of confirm() to a variable
var answerVar = confirm("Message Text Here")
toPrecision(precision)
document.getElementById("textAreaId").value = "Text Value";
v
47. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
var dateObject = new Date("11/22/2012 18:25:35")
Number.NEGATIVE_INFINITY
var functionName = function(param1, param2, paramN) {}
setMilliseconds()
48. The _____ attribute is used to denote external file for script use
Src - e.g. <script src="fileName.js"> //
document.getElementById("radioButtonId").checked;
!==
(Condition_Expression) ? Value_If_True : Value_If_False;
49. To set the current checked status of the control for checkboxes
document.getElementById("CheckboxId").checked = true; //Could also be false
Math.abs(number)
document.getElementById("textAreaId").value = "Text Value";
confirm()
50. The string escape sequence to start a new line in JavaScript
n
Number.NEGATIVE_INFINITY
Either single or double quotes surrounding the data
concat(var1, var2, varN)