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 assign a default value to a prompt
concat(var1, var2, varN)
===
Use the second parameter. Example: prompt("Enter Age:", "18")
Objects
2. To create a new Date object
string
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
Objects
document.getElementById("TextBoxId").focus;
3. To make the browser load a new page using JavaScript
<noscript>
window.location = "New Web Address Here";
document.getElementById("TextBoxId").value;
window.location()
4. To create a Date object in JavaScript
var arrayVar = new Array()
document.getElementById("TextBoxId").disabled = true;
event handler .
var dateVar = new Date()
5. JavaScript is case _______
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
<noscript>
document.getElementById("textAreaId").value = "Text Value";
sensitive
6. Math object method used to return the highest value from a set of supplied numbers
Math.max(var1, var2, varN)
setMilliseconds()
var stringVar = "part 1:" + "part 2";
toTimeString()
7. Date object method used to return a string containing the time
\
document.getElementById("textAreaId").value;
document.getElementById("checkboxId").value;
toTimeString()
8. This returns only True or false values
document.getElementById("checkboxId").value;
window.location()
<noscript>
confirm()
9. Number object method used to round numbers to the specified number of decimal places
if (condition) {}
Math.random() //Returns a value >= 0.0 but <1.0
toFixed(digits)
setMilliseconds()
10. To assign the value from a prompt to a string
document.getElementById("TextBoxId").disabled = true;
var stringVar = prompt("Text Here")
document.write("Text Here") //Remains on current line
document.getElementById("TextBoxId").value;
11. The escape sequence used to insert a Unicode character into a string in JavaScript
\
udddd
r
confirm("Message Text Here")
12. When you __________ a javascript variable it retains its original value
Multi line
redeclare
isNaN(varHere) //Returns true or false.
var arrayVar = new Array()
13. To assign actions to the window onLoad event
'
if (condition) {}
substring(startIndex)
window.onload = function() {//actions here}
14. The string escape sequence to start a new line in JavaScript
n
while (condition) {}
document.getElementById("TextBoxId").disabled = true;
getFullYear()
15. Number object method used to return a string with a given number base
<script type="text/javascript">.....</script>
toString(base)
Underscores
document.getElementById("listId").value;
16. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
Objects
Underscores
Math.abs(number)
document.getElementById("TextBoxId").value;
17. Math object method used to return a given number that has been rounded to the closes integer value
Math.round(number)
Math.floor(number)
v
t
18. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
event handler .
!==
Math.abs(number)
window.onload = function() {//actions here}
19. The syntax of a conditional operator
(Condition_Expression) ? Value_If_True : Value_If_False;
substring(startIndex)
Math.abs(number)
document.getElementById("radioButtonId").checked = true; //Could also be false
20. The string escape sequence to insert a tab in JavaScript
var stringVar = "part 1:" + "part 2";
t
setMilliseconds()
document.getElementById(id)
21. Math object method used to return a given number raised to a given power
redeclare
Math.pow(number, power)
v
var variableName;
22. To set the digit precision of a decimal number
===
Either single or double quotes surrounding the data
toString(base)
toFixed(digitCount)
23. 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 stringVar = prompt("Text Here")
expression
24. Math object method used to return a given number rounded to the next lowest integer value
while (condition) {}
alert("Alert Text Here")
Math.floor(number)
document.getElementById("TextBoxId").disabled = true;
25. Date object method used to return a string containing the date and time
document.getElementById("TextBoxId").value;
document.getElementById("textAreaId").value = "Text Value";
var functionName = function(param1, param2, paramN) {}
toString()
26. The valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
Math.floor(number)
Underscores
document.write("Text Here") //Remains on current line
Charset
27. To set the current checked status of the control for radio buttons
indexOf(searchValue, startPosition)
toUpperCase()
document.getElementById("radioButtonId").value;
document.getElementById("radioButtonId").checked = true; //Could also be false
28. To alter the value of the text element in a span tag
Src - e.g. <script src="fileName.js"> //
redeclare
ondblclick
document.getElementById("spanId").firstChild.nodeValue = "New Value";
29. 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
30. ________ comments start with / and end with /.
Math.random() //Returns a value >= 0.0 but <1.0
Multi line
setMilliseconds()
event handler .
31. The events common to most controls: onfocus - onblur - onclick - _______ - onchange - onselect
toFixed(digitCount)
Math.random() //Returns a value >= 0.0 but <1.0
ondblclick
Use the second parameter. Example: prompt("Enter Age:", "18")
32. To code a while statement in JavaScript
document.getElementById("textAreaId").value;
var dateObject = new Date("11/22/2012 18:25:35")
while (condition) {}
string
33. To concatenate multiple parts into a string
Multi line
var stringVar = "part 1:" + "part 2";
document.getElementById("ButtonId").onclick = functionName;
getFullYear()
34. To get the current checked status of the control for checkboxes
document.getElementById(id)
var functionName = function(param1, param2, paramN) {}
document.getElementById("TextBoxId").disabled = true;
document.getElementById("checkboxId").checked;
35. To display a confirmation
confirm("Message Text Here")
var functionName = function(param1, param2, paramN) {}
document.getElementById("TextBoxId").value;
Charset
36. To set focus on the control for textboxes
Math.max(var1, var2, varN)
focus
document.getElementById("TextBoxId").focus;
document.getElementById("TextBoxId").disabled = true;
37. To get the text value of the control for radio buttons
prompt("Text Here")
document.getElementById("TextBoxId").focus;
Use the second parameter. Example: prompt("Enter Age:", "18")
document.getElementById("radioButtonId").value;
38. To set the current value of the control for a text area
r
document.getElementById("textAreaId").value = "Text Value";
toString()
Math.max(var1, var2, varN)
39. What String object method returns a new string containing the value of the original string but in all upper case
toUpperCase()
document.getElementById("spanId").firstChild;
redeclare
Either single or double quotes surrounding the data
40. Math object method used to return a given number rounded to the next highest integer value
document.getElementById(id)
Math.ceil(number)
standard equality operators
Objects
41. To code a button.onclick event handler
toFixed(digits)
Math.round(number)
Multi line
document.getElementById("ButtonId").onclick = functionName;
42. Number object method used to return a number in exponential format with the specified number of decimal places
window.onload = function() {//actions here}
toExponential(digits)
r
f
43. To assign the value from a prompt to a non-string variable
concat(var1, var2, varN)
document.getElementById("CheckboxId").checked = true; //Could also be false
substring(startIndex, stopIndex)
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
44. The string escape sequence to insert a double quote in JavaScript
document.getElementById("TextBoxId").disabled = true;
"
while (condition) {}
Charset
45. A statement that yields a value
document.getElementById("radioButtonId").checked = true; //Could also be false
Multi line
Either single or double quotes surrounding the data
expression
46. To set the current checked status of the control for checkboxes
charAt(position)
document.getElementById("CheckboxId").checked = true; //Could also be false
r
expression
47. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
Math.round(number)
Number.NEGATIVE_INFINITY
var stringVar = prompt("Text Here")
document.getElementById("TextBoxId").value;
48. To assign the return value of confirm() to a variable
event handler .
toTimeString()
'
var answerVar = confirm("Message Text Here")
49. The identity operator for equals
charAt(position)
sensitive
!==
===
50. Number object method used to return a numerical string with the specified number of significant digits
toPrecision(precision)
var stringVar = "part 1:" + "part 2";
toFixed(digitCount)
var dateObject = new Date("11/22/2012 18:25:35")