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