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