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. A statement that yields a value
expression
semicolon ";"
(Condition_Expression) ? Value_If_True : Value_If_False;
document.getElementById("radioButtonId").value;
2. The _____ attribute is used to denote external file for script use
Src - e.g. <script src="fileName.js"> //
Math.pow(number, power)
<noscript>
charAt(position)
3. To test that a variable contains a valid number
document.getElementById("CheckboxId").checked = true; //Could also be false
===
isNaN(varHere) //Returns true or false.
substring(startIndex)
4. To set the current checked status of the control for radio buttons
document.getElementById("radioButtonId").checked = true; //Could also be false
var arrayVar = new Array()
<noscript>
confirm("Message Text Here")
5. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
document.getElementById("ButtonId").onclick = functionName;
var dateVar = new Date()
<script type="text/javascript">.....</script>
Objects
6. The four attributes of the <script> tag:Type - Src - _____ and Defer
confirm()
document.getElementById("CheckboxId").checked = true; //Could also be false
toString()
Charset
7. 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
Multi line
substring(startIndex, stopIndex)
document.getElementById("ButtonId").onclick = functionName;
document.getElementById("TextBoxId").focus;
8. To create a Date object in JavaScript
Underscores
var dateVar = new Date()
isNaN(varHere) //Returns true or false.
Objects
9. To assign the return value of confirm() to a variable
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
semicolon ";"
var answerVar = confirm("Message Text Here")
n
10. Math object method used to return the highest value from a set of supplied numbers
Math.max(var1, var2, varN)
<noscript>
!==
n
11. JavaScript is case _______
document.getElementById("checkboxId").checked;
!==
var dateObject = new Date("11/22/2012 18:25:35")
sensitive
12. To write text to the current element of the DOM
document.getElementById("radioButtonId").checked = true; //Could also be false
Math.pow(number, power)
if (condition) {}
document.write("Text Here") //Remains on current line
13. The string escape sequence to insert a vertical tab in JavaScript
v
expression
(Condition_Expression) ? Value_If_True : Value_If_False;
'
14. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
document.getElementById("radioButtonId").checked;
var dateVar = new Date()
Number.NEGATIVE_INFINITY
Objects
15. The string escape sequence to insert a double quote in JavaScript
document.getElementById("textAreaId").value;
"
Use the second parameter. Example: prompt("Enter Age:", "18")
Multi line
16. Date object method used to return a string containing the time
toTimeString()
document.getElementById("TextBoxId").disabled = true;
document.getElementById("spanId").firstChild;
prompt("Text Here")
17. Number object method used to return a numerical string with the specified number of significant digits
Multi line
toPrecision(precision)
confirm("Message Text Here")
event handler .
18. Math object method used to return the absolute value of a given number
Math.abs(number)
Math.sqrt(number)
toFixed(digits)
"
19. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
setMilliseconds()
document.getElementById("listId").value;
event handler .
var arrayVar = new Array()
20. To assign the value from a prompt to a non-string variable
substring(startIndex)
<script type="text/javascript">.....</script>
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
charAt(position)
21. To display a confirmation
window.location = "New Web Address Here";
Math.round(number)
Two forward slashes "//"
confirm("Message Text Here")
22. To code a while statement in JavaScript
udddd
document.getElementById("TextBoxId").value;
while (condition) {}
toFixed(digitCount)
23. To set the digit precision of a decimal number
document.writeln("Text Here") //Advances to new line after text
setMilliseconds()
document.getElementById("TextBoxId").disabled = true;
toFixed(digitCount)
24. To get the value or the currently selected item for lists
document.getElementById("listId").value;
standard equality operators
toDateString()
Math.random() //Returns a value >= 0.0 but <1.0
25. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
alert("Alert Text Here")
\
focus
Math.ceil(number)
26. Date object method used to return a string containing the date and time
\
toString()
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Objects
27. To create a function that returns a value in JavaScript
Math.abs(number)
var functionName = function(param1, param2, paramN) {}
Math.pow(number, power)
Math.min(var1, var2, varN)
28. What Date object method is used to return the number of milliseconds since the start of GMT
toLowerCase()
Math.sqrt(number)
getTime()
document.getElementById("ButtonId").onclick = functionName;
29. The syntax of a conditional operator
(Condition_Expression) ? Value_If_True : Value_If_False;
standard equality operators
focus
Math.pow(number, power)
30. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
document.getElementById("spanId").firstChild;
Objects
n
getFullYear()
31. To access the text element in a <span> tag
string
document.getElementById("ButtonId").onclick = functionName;
Two forward slashes "//"
document.getElementById("spanId").firstChild;
32. To display an alert
var functionName = function(param1, param2, paramN) {}
Math.random() //Returns a value >= 0.0 but <1.0
alert("Alert Text Here")
prompt("Text Here")
33. Math object method used to return a given number rounded to the next lowest integer value
focus
Math.floor(number)
window.onload = function() {//actions here}
Use the second parameter. Example: prompt("Enter Age:", "18")
34. Number object method used to return a string with a given number base
substring(startIndex)
document.getElementById("radioButtonId").value;
!==
toString(base)
35. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
Underscores
<script type="text/javascript">.....</script>
document.getElementById("checkboxId").value;
document.write("Text Here") //Remains on current line
36. When you __________ a javascript variable it retains its original value
var functionName = function(param1, param2, paramN) {}
toFixed(digits)
redeclare
document.getElementById("radioButtonId").checked = true; //Could also be false
37. To write a line to the current element of the DOM (Document Object Model)
document.getElementById("TextBoxId").focus;
var stringVar = prompt("Text Here")
document.writeln("Text Here") //Advances to new line after text
\
38. What String object method returns a new string containing the value of the original string but in all upper case
toUpperCase()
ondblclick
global
alert("Alert Text Here")
39. To get the current checked status of the control for radio buttons
!==
document.getElementById("radioButtonId").checked;
===
var functionName = function(param1, param2, paramN) {}
40. Command to display a prompt
confirm("Message Text Here")
prompt("Text Here")
window.location()
isNaN(varHere) //Returns true or false.
41. Date object method used to return a string containing the date
document.getElementById("textAreaId").value = "Text Value";
document.getElementById("checkboxId").value;
toDateString()
document.getElementById("ButtonId").onclick = functionName;
42. The string escape sequence to insert a single quote in JavaScript
43. The format to create a new Date object from a string
document.getElementById("TextBoxId").value;
var dateObject = new Date("11/22/2012 18:25:35")
Math.pow(number, power)
var arrayVar = new Array()
44. The string escape sequence to insert a carriage return in JavaScript
document.getElementById("radioButtonId").checked = true; //Could also be false
toFixed(digits)
Math.max(var1, var2, varN)
r
45. String object method used to concatenate multiple strings
document.getElementById("radioButtonId").value;
concat(var1, var2, varN)
Math.random() //Returns a value >= 0.0 but <1.0
!==
46. To make the browser load a new page using JavaScript
v
Math.random() //Returns a value >= 0.0 but <1.0
toFixed(digitCount)
window.location = "New Web Address Here";
47. The string escape sequence to start a new line in JavaScript
\
n
concat(var1, var2, varN)
semicolon ";"
48. The escape sequence used to insert a Unicode character into a string in JavaScript
toPrecision(precision)
udddd
substring(startIndex)
document.getElementById("radioButtonId").checked;
49. To get the text value of the control for radio buttons
window.location()
document.getElementById("radioButtonId").value;
var stringVar = prompt("Text Here")
toLowerCase()
50. The identity operator for equals
var answerVar = confirm("Message Text Here")
toString(base)
===
v