SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
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 escape sequence used to insert a Unicode character into a string in JavaScript
===
isNaN(varHere) //Returns true or false.
toString(base)
udddd
2. To insert Javascript into a web page
toTimeString()
"
<script type="text/javascript">.....</script>
Underscores
3. Date object method used to return a string containing the date
Math.ceil(number)
toDateString()
toString(base)
toUpperCase()
4. Math object method used to return the absolute value of a given number
toString()
standard equality operators
Math.abs(number)
Math.round(number)
5. To test that a variable contains a valid number
var stringVar = prompt("Text Here")
setMilliseconds()
var functionName = function(param1, param2, paramN) {}
isNaN(varHere) //Returns true or false.
6. The _____ attribute is used to denote external file for script use
Src - e.g. <script src="fileName.js"> //
Underscores
indexOf(searchValue, startPosition)
toTimeString()
7. To create a function that returns a value in JavaScript
document.getElementById("TextBoxId").focus;
var functionName = function(param1, param2, paramN) {}
substring(startIndex, stopIndex)
charAt(position)
8. To view the current web address using JavaScript
window.location()
var dateObject = new Date("11/22/2012 18:25:35")
while (condition) {}
document.getElementById("radioButtonId").checked = true; //Could also be false
9. The identity operator for not equal
!==
indexOf(searchValue, startPosition)
standard equality operators
\
10. To access the text element in a <span> tag
semicolon ";"
Two forward slashes "//"
document.getElementById("spanId").firstChild;
t
11. Math object method used to return a given number rounded to the next highest integer value
Math.ceil(number)
toExponential(digits)
\
document.getElementById("spanId").firstChild;
12. The string escape sequence to insert a form feed in JavaScript
document.getElementById("radioButtonId").checked = true; //Could also be false
===
f
Multi line
13. Date object method used to return a string containing the time
Number.NEGATIVE_INFINITY
semicolon ";"
toTimeString()
(Condition_Expression) ? Value_If_True : Value_If_False;
14. What String object method returns a new string containing the value of the original string but in all upper case
Math.pow(number, power)
Either single or double quotes surrounding the data
toUpperCase()
document.getElementById("textAreaId").value;
15. To get the current checked status of the control for checkboxes
document.getElementById("checkboxId").checked;
t
toDateString()
document.getElementById("spanId").firstChild.nodeValue = "New Value";
16. The string escape sequence to start a new line in JavaScript
n
concat(var1, var2, varN)
toUpperCase()
document.getElementById("TextBoxId").focus;
17. To access a page element by id
prompt("Text Here")
document.getElementById(id)
Math.random() //Returns a value >= 0.0 but <1.0
toUpperCase()
18. Number object method used to return a number in exponential format with the specified number of decimal places
var arrayVar = new Array()
toDateString()
Math.round(number)
toExponential(digits)
19. Statements end in JavaScript with a ________
semicolon ";"
document.getElementById("textAreaId").value = "Text Value";
document.getElementById("TextBoxId").value;
"
20. Math object method used to return the highest value from a set of supplied numbers
Math.max(var1, var2, varN)
window.location = "New Web Address Here";
<noscript>
if (condition) {}
21. To get the text value of the control for radio buttons
document.getElementById("spanId").firstChild.nodeValue = "New Value";
semicolon ";"
document.getElementById("checkboxId").value;
Math.pow(number, power)
22. The string escape sequence to insert a tab in JavaScript
Math.sqrt(number)
string
document.getElementById("TextBoxId").disabled = true;
t
23. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
getTime()
substring(startIndex)
Underscores
document.getElementById("checkboxId").value;
24. To alter the value of the text element in a span tag
document.getElementById("spanId").firstChild.nodeValue = "New Value";
var stringVar = prompt("Text Here")
Math.floor(number)
prompt("Text Here")
25. To set the current checked status of the control for radio buttons
document.getElementById("radioButtonId").checked = true; //Could also be false
redeclare
Math.abs(number)
toExponential(digits)
26. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
document.getElementById("spanId").firstChild;
confirm("Message Text Here")
getFullYear()
var functionName = function(param1, param2, paramN) {}
27. To concatenate multiple parts into a string
var stringVar = "part 1:" + "part 2";
semicolon ";"
document.getElementById("checkboxId").value;
string
28. To code a while statement in JavaScript
setMilliseconds()
global
while (condition) {}
Underscores
29. To display a confirmation
confirm("Message Text Here")
Underscores
var stringVar = prompt("Text Here")
for (counter; condition; incrementor) {}
30. The format to create a new Date object from a string
var dateObject = new Date("11/22/2012 18:25:35")
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
document.getElementById("CheckboxId").checked = true; //Could also be false
v
31. Unlike ________________ identity operators do not perform type coercion.
standard equality operators
===
if (condition) {}
document.getElementById("textAreaId").value = "Text Value";
32. To create a new Date object
Math.pow(number, power)
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
var stringVar = "part 1:" + "part 2";
r
33. To set the digit precision of a decimal number
Math.max(var1, var2, varN)
r
if (condition) {}
toFixed(digitCount)
34. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
while (condition) {}
window.location()
<noscript>
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
35. Command to display a prompt
document.getElementById("radioButtonId").checked;
Src - e.g. <script src="fileName.js"> //
n
prompt("Text Here")
36. To set the control to be disabled for textboxes
document.getElementById("TextBoxId").disabled = true;
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
document.getElementById("CheckboxId").checked = true; //Could also be false
document.getElementById("ButtonId").onclick = functionName;
37. String object method used to get the character at a specified index position
charAt(position)
toExponential(digits)
document.getElementById(id)
Charset
38. To code a for statement in JavaScript
Math.ceil(number)
event handler .
Charset
for (counter; condition; incrementor) {}
39. To get the current checked status of the control for radio buttons
toUpperCase()
var arrayVar = new Array()
<noscript>
document.getElementById("radioButtonId").checked;
40. To set the current value of the control for a text area
document.getElementById("listId").value;
udddd
toFixed(digits)
document.getElementById("textAreaId").value = "Text Value";
41. To get the current value of the control for a text area
toLowerCase()
document.write("Text Here") //Remains on current line
var dateVar = new Date()
document.getElementById("textAreaId").value;
42. To code an If statement in JavaScript
toExponential(digits)
redeclare
toDateString()
if (condition) {}
43. The identity operator for equals
f
<noscript>
document.getElementById("radioButtonId").checked;
===
44. Math object method used to return a given number that has been rounded to the closes integer value
focus
document.getElementById("spanId").firstChild.nodeValue = "New Value";
substring(startIndex, stopIndex)
Math.round(number)
45. String object method used to return the position of the first instance of a specified search string starting from the specified index
document.getElementById("checkboxId").checked;
setMilliseconds()
toLowerCase()
indexOf(searchValue, startPosition)
46. To code a button.onclick event handler
document.getElementById("spanId").firstChild.nodeValue = "New Value";
Math.random() //Returns a value >= 0.0 but <1.0
document.getElementById("ButtonId").onclick = functionName;
toExponential(digits)
47. String object method used to concatenate multiple strings
while (condition) {}
concat(var1, var2, varN)
standard equality operators
var variableName;
48. The syntax of a conditional operator
focus
Underscores
document.write("Text Here") //Remains on current line
(Condition_Expression) ? Value_If_True : Value_If_False;
49. JavaScript is case _______
sensitive
Math.abs(number)
document.getElementById("checkboxId").value;
document.getElementById("checkboxId").checked;
50. The events common to most controls: onfocus - onblur - onclick - _______ - onchange - onselect
Underscores
document.getElementById("TextBoxId").disabled = true;
confirm()
ondblclick