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. To code an If statement in JavaScript
v
if (condition) {}
Charset
global
2. To assign the return value of confirm() to a variable
document.getElementById("listId").value;
var answerVar = confirm("Message Text Here")
Src - e.g. <script src="fileName.js"> //
Math.floor(number)
3. The string escape sequence to insert a tab in JavaScript
Math.max(var1, var2, varN)
Number.NEGATIVE_INFINITY
toExponential(digits)
t
4. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
var functionName = function(param1, param2, paramN) {}
toFixed(digitCount)
getFullYear()
global
5. The four attributes of the <script> tag:Type - Src - _____ and Defer
getTime()
Charset
var functionName = function(param1, param2, paramN) {}
Underscores
6. To set the control to be disabled for textboxes
Src - e.g. <script src="fileName.js"> //
var variableName;
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
document.getElementById("TextBoxId").disabled = true;
7. A statement that yields a value
toTimeString()
prompt("Text Here")
document.getElementById("radioButtonId").checked;
expression
8. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________
<script type="text/javascript">.....</script>
setMilliseconds()
!==
Math.ceil(number)
9. Math object method used to return a given number rounded to the next highest integer value
document.getElementById("TextBoxId").focus;
toFixed(digitCount)
Math.ceil(number)
for (counter; condition; incrementor) {}
10. To create a function that returns a value in JavaScript
toString()
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Charset
var functionName = function(param1, param2, paramN) {}
11. The identity operator for equals
while (condition) {}
r
"
===
12. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
Two forward slashes "//"
Number.NEGATIVE_INFINITY
document.getElementById("checkboxId").checked;
Multi line
13. The string escape sequence to insert a single quote in JavaScript
14. Date object method used to return a string containing the date
var variableName;
toDateString()
document.getElementById("TextBoxId").disabled = true;
window.location()
15. To get the text value of the control for radio buttons
var arrayVar = new Array()
document.getElementById("checkboxId").value;
window.location()
sensitive
16. Number object method used to return a string with a given number base
document.getElementById("listId").value;
document.getElementById("TextBoxId").focus;
toString(base)
Charset
17. The format to create a new Date object from a string
Math.min(var1, var2, varN)
Either single or double quotes surrounding the data
var functionName = function(param1, param2, paramN) {}
var dateObject = new Date("11/22/2012 18:25:35")
18. To assign a default value to a prompt
window.location = "New Web Address Here";
window.onload = function() {//actions here}
Use the second parameter. Example: prompt("Enter Age:", "18")
toExponential(digits)
19. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
'
Objects
Underscores
string
20. String object method used to concatenate multiple strings
toFixed(digits)
Math.max(var1, var2, varN)
"
concat(var1, var2, varN)
21. Math object method used to return a given number rounded to the next lowest integer value
document.getElementById("checkboxId").value;
document.write("Text Here") //Remains on current line
Math.floor(number)
document.getElementById("radioButtonId").checked = true; //Could also be false
22. To set the current checked status of the control for radio buttons
<noscript>
var dateObject = new Date("11/22/2012 18:25:35")
document.getElementById("radioButtonId").checked = true; //Could also be false
substring(startIndex, stopIndex)
23. Math object method used to return the absolute value of a given number
if (condition) {}
while (condition) {}
Math.sqrt(number)
Math.abs(number)
24. To create a Date object in JavaScript
document.getElementById(id)
<script type="text/javascript">.....</script>
var dateVar = new Date()
\
25. To create an Array object in JavaScript
document.getElementById("radioButtonId").checked = true; //Could also be false
var arrayVar = new Array()
global
while (condition) {}
26. This returns only True or false values
document.getElementById("textAreaId").value;
document.getElementById("spanId").firstChild.nodeValue = "New Value";
confirm()
udddd
27. Unlike ________________ identity operators do not perform type coercion.
var stringVar = "part 1:" + "part 2";
standard equality operators
f
isNaN(varHere) //Returns true or false.
28. Date object method used to return a string containing the date and time
toString()
\
concat(var1, var2, varN)
document.getElementById("spanId").firstChild;
29. Statements end in JavaScript with a ________
document.write("Text Here") //Remains on current line
semicolon ";"
document.getElementById("textAreaId").value = "Text Value";
document.getElementById("TextBoxId").value;
30. To get the text value of the control for radio buttons
string
'
Math.pow(number, power)
document.getElementById("radioButtonId").value;
31. To assign actions to the window onLoad event
substring(startIndex, stopIndex)
Math.ceil(number)
window.onload = function() {//actions here}
document.getElementById("CheckboxId").checked = true; //Could also be false
32. To display an alert
alert("Alert Text Here")
var stringVar = prompt("Text Here")
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
t
33. Command to display a prompt
prompt("Text Here")
n
Multi line
var dateObject = new Date("11/22/2012 18:25:35")
34. The string escape sequence to insert a form feed in JavaScript
confirm("Message Text Here")
if (condition) {}
Math.ceil(number)
f
35. The _____ attribute is used to denote external file for script use
confirm()
toFixed(digitCount)
document.getElementById("TextBoxId").disabled = true;
Src - e.g. <script src="fileName.js"> //
36. ________ comments start with / and end with /.
r
Math.sqrt(number)
substring(startIndex, stopIndex)
Multi line
37. To create a single line comment in JavaScript
Two forward slashes "//"
var answerVar = confirm("Message Text Here")
substring(startIndex, stopIndex)
document.getElementById("spanId").firstChild.nodeValue = "New Value";
38. To set focus on the control for textboxes
string
document.getElementById("checkboxId").value;
document.getElementById("TextBoxId").focus;
var answerVar = confirm("Message Text Here")
39. To view the current web address using JavaScript
f
document.getElementById("CheckboxId").checked = true; //Could also be false
window.location()
substring(startIndex, stopIndex)
40. To get the value or the currently selected item for lists
document.getElementById("listId").value;
document.getElementById("radioButtonId").checked;
Objects
standard equality operators
41. The escape sequence used to insert a Unicode character into a string in JavaScript
udddd
isNaN(varHere) //Returns true or false.
getTime()
document.getElementById("TextBoxId").value;
42. To access a page element by id
concat(var1, var2, varN)
Src - e.g. <script src="fileName.js"> //
setMilliseconds()
document.getElementById(id)
43. String object method used to return the position of the first instance of a specified search string starting from the specified index
indexOf(searchValue, startPosition)
var answerVar = confirm("Message Text Here")
Two forward slashes "//"
Math.max(var1, var2, varN)
44. Number object method used to return a numerical string with the specified number of significant digits
var answerVar = confirm("Message Text Here")
for (counter; condition; incrementor) {}
toPrecision(precision)
toUpperCase()
45. To access the text element in a <span> tag
===
charAt(position)
document.getElementById("spanId").firstChild;
<script type="text/javascript">.....</script>
46. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
semicolon ";"
<noscript>
"
udddd
47. The string escape sequence to insert a backslash in JavaScript
document.getElementById("TextBoxId").value;
toTimeString()
'
\
48. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
toPrecision(precision)
var dateObject = new Date("11/22/2012 18:25:35")
var arrayVar = new Array()
focus
49. Number object method used to return a number in exponential format with the specified number of decimal places
toUpperCase()
f
toExponential(digits)
while (condition) {}
50. To get the current checked status of the control for radio buttons
confirm("Message Text Here")
var arrayVar = new Array()
Math.max(var1, var2, varN)
document.getElementById("radioButtonId").checked;