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. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
semicolon ";"
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Underscores
document.getElementById("radioButtonId").checked = true; //Could also be false
2. To make the browser load a new page using JavaScript
===
window.location = "New Web Address Here";
while (condition) {}
(Condition_Expression) ? Value_If_True : Value_If_False;
3. To get the current value for textboxes
Either single or double quotes surrounding the data
document.getElementById("TextBoxId").value;
(Condition_Expression) ? Value_If_True : Value_If_False;
confirm()
4. Math object method used to return the lowest value for a set of supplied numbers
Math.min(var1, var2, varN)
\
document.getElementById("radioButtonId").value;
===
5. What String object method returns a new string containing the value of the original string but in all upper case
document.getElementById("radioButtonId").checked;
toUpperCase()
confirm()
document.getElementById("spanId").firstChild.nodeValue = "New Value";
6. What String object method returns a new string containing the value of the original string but in all lower case
document.getElementById("radioButtonId").value;
udddd
toLowerCase()
===
7. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
event handler .
focus
document.write("Text Here") //Remains on current line
<noscript>
8. String object method used to return a new string that contains part of the original string from the specified start position
'
substring(startIndex)
var variableName;
t
9. The format to create a new Date object from a string
redeclare
var dateObject = new Date("11/22/2012 18:25:35")
document.getElementById("radioButtonId").checked = true; //Could also be false
var arrayVar = new Array()
10. JavaScript is case _______
r
sensitive
'
Math.min(var1, var2, varN)
11. To set the current checked status of the control for checkboxes
document.getElementById("CheckboxId").checked = true; //Could also be false
redeclare
document.write("Text Here") //Remains on current line
charAt(position)
12. To assign the value from a prompt to a non-string variable
ondblclick
setMilliseconds()
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
toExponential(digits)
13. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
toUpperCase()
event handler .
getFullYear()
f
14. To get the current checked status of the control for radio buttons
document.getElementById("radioButtonId").checked;
toFixed(digitCount)
toFixed(digits)
document.getElementById("listId").value;
15. To code a for statement in JavaScript
redeclare
while (condition) {}
document.getElementById("radioButtonId").checked = true; //Could also be false
for (counter; condition; incrementor) {}
16. To set focus on the control for textboxes
document.getElementById("TextBoxId").focus;
focus
document.getElementById("ButtonId").onclick = functionName;
toTimeString()
17. To get the text value of the control for radio buttons
Math.random() //Returns a value >= 0.0 but <1.0
document.getElementById("radioButtonId").checked = true; //Could also be false
var arrayVar = new Array()
document.getElementById("checkboxId").value;
18. The string escape sequence to start a new line in JavaScript
toDateString()
(Condition_Expression) ? Value_If_True : Value_If_False;
document.getElementById("radioButtonId").checked;
n
19. To code a while statement in JavaScript
document.getElementById("ButtonId").onclick = functionName;
toString()
while (condition) {}
toTimeString()
20. To create a new Date object
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
document.getElementById("TextBoxId").focus;
Math.round(number)
window.location()
21. To create a single line comment in JavaScript
Two forward slashes "//"
document.getElementById("CheckboxId").checked = true; //Could also be false
f
document.getElementById("radioButtonId").value;
22. To create an Array object in JavaScript
var arrayVar = new Array()
Either single or double quotes surrounding the data
substring(startIndex)
focus
23. The identity operator for not equal
!==
f
alert("Alert Text Here")
document.getElementById("TextBoxId").focus;
24. To write a line to the current element of the DOM (Document Object Model)
document.writeln("Text Here") //Advances to new line after text
global
ondblclick
for (counter; condition; incrementor) {}
25. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
event handler .
indexOf(searchValue, startPosition)
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
var dateVar = new Date()
26. Math object method used to return the highest value from a set of supplied numbers
<noscript>
document.getElementById("spanId").firstChild.nodeValue = "New Value";
Math.max(var1, var2, varN)
confirm("Message Text Here")
27. What Date object method is used to return the number of milliseconds since the start of GMT
Math.sqrt(number)
document.getElementById(id)
document.getElementById("CheckboxId").checked = true; //Could also be false
getTime()
28. To set the current checked status of the control for radio buttons
Math.round(number)
string
document.getElementById("spanId").firstChild;
document.getElementById("radioButtonId").checked = true; //Could also be false
29. Date object method used to return a string containing the date
toDateString()
!==
document.getElementById("radioButtonId").checked;
ondblclick
30. When you __________ a javascript variable it retains its original value
focus
redeclare
var dateObject = new Date("11/22/2012 18:25:35")
document.getElementById("CheckboxId").checked = true; //Could also be false
31. To insert Javascript into a web page
document.getElementById(id)
document.getElementById("spanId").firstChild.nodeValue = "New Value";
Math.max(var1, var2, varN)
<script type="text/javascript">.....</script>
32. To write text to the current element of the DOM
window.location()
document.write("Text Here") //Remains on current line
focus
document.getElementById("spanId").firstChild;
33. The escape sequence used to insert a Unicode character into a string in JavaScript
focus
Multi line
udddd
document.getElementById(id)
34. Number object method used to return a numerical string with the specified number of significant digits
v
document.getElementById("textAreaId").value;
Math.sqrt(number)
toPrecision(precision)
35. To access a page element by id
document.getElementById("spanId").firstChild;
document.getElementById("radioButtonId").checked;
document.getElementById(id)
isNaN(varHere) //Returns true or false.
36. Number object method used to round numbers to the specified number of decimal places
toFixed(digits)
document.getElementById(id)
n
toFixed(digitCount)
37. To assign actions to the window onLoad event
setMilliseconds()
window.onload = function() {//actions here}
Math.round(number)
var answerVar = confirm("Message Text Here")
38. To get the current value of the control for a text area
Math.round(number)
document.getElementById("textAreaId").value;
var functionName = function(param1, param2, paramN) {}
sensitive
39. String object method used to concatenate multiple strings
document.getElementById("radioButtonId").value;
document.getElementById("spanId").firstChild;
Math.round(number)
concat(var1, var2, varN)
40. String object method used to get the character at a specified index position
toTimeString()
'
Number.NEGATIVE_INFINITY
charAt(position)
41. To create a Date object in JavaScript
Math.abs(number)
var dateVar = new Date()
var dateObject = new Date("11/22/2012 18:25:35")
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
42. 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
43. To test that a variable contains a valid number
isNaN(varHere) //Returns true or false.
prompt("Text Here")
document.getElementById("radioButtonId").checked = true; //Could also be false
var stringVar = prompt("Text Here")
44. To denote a string in JavaScript
document.writeln("Text Here") //Advances to new line after text
toTimeString()
getFullYear()
Either single or double quotes surrounding the data
45. To get the current checked status of the control for checkboxes
document.getElementById("radioButtonId").checked = true; //Could also be false
document.getElementById("radioButtonId").checked;
alert("Alert Text Here")
document.getElementById("checkboxId").checked;
46. To set the digit precision of a decimal number
toFixed(digitCount)
while (condition) {}
standard equality operators
v
47. The string escape sequence to insert a carriage return in JavaScript
getFullYear()
"
r
for (counter; condition; incrementor) {}
48. The string escape sequence to insert a double quote in JavaScript
window.location = "New Web Address Here";
\
"
Objects
49. To assign a default value to a prompt
global
isNaN(varHere) //Returns true or false.
Use the second parameter. Example: prompt("Enter Age:", "18")
Math.min(var1, var2, varN)
50. ________ comments start with / and end with /.
Multi line
isNaN(varHere) //Returns true or false.
document.getElementById("TextBoxId").disabled = true;
udddd