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