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 test that a variable contains a valid number
window.location()
isNaN(varHere) //Returns true or false.
toFixed(digitCount)
document.writeln("Text Here") //Advances to new line after text
2. The string escape sequence to insert a tab in JavaScript
t
document.getElementById("TextBoxId").disabled = true;
Either single or double quotes surrounding the data
redeclare
3. Command to display a prompt
prompt("Text Here")
<script type="text/javascript">.....</script>
document.getElementById("textAreaId").value = "Text Value";
document.getElementById("listId").value;
4. 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
5. The identity operator for equals
standard equality operators
Either single or double quotes surrounding the data
expression
===
6. To set the digit precision of a decimal number
confirm("Message Text Here")
v
toFixed(digitCount)
toString(base)
7. ________ comments start with / and end with /.
document.writeln("Text Here") //Advances to new line after text
toString()
Multi line
Charset
8. String object method used to concatenate multiple strings
toExponential(digits)
document.getElementById("ButtonId").onclick = functionName;
"
concat(var1, var2, varN)
9. To write text to the current element of the DOM
document.getElementById("textAreaId").value = "Text Value";
document.write("Text Here") //Remains on current line
Two forward slashes "//"
<script type="text/javascript">.....</script>
10. Date object method used to return a string containing the time
var dateVar = new Date()
toExponential(digits)
document.getElementById("spanId").firstChild.nodeValue = "New Value";
toTimeString()
11. To create a new Date object
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
window.location = "New Web Address Here";
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
document.getElementById("TextBoxId").disabled = true;
12. To assign actions to the window onLoad event
<noscript>
window.onload = function() {//actions here}
!==
<script type="text/javascript">.....</script>
13. To get the current value for textboxes
document.writeln("Text Here") //Advances to new line after text
alert("Alert Text Here")
document.getElementById("TextBoxId").value;
prompt("Text Here")
14. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
Number.NEGATIVE_INFINITY
while (condition) {}
indexOf(searchValue, startPosition)
Math.pow(number, power)
15. Number object method used to return a number in exponential format with the specified number of decimal places
'
toExponential(digits)
Math.min(var1, var2, varN)
Charset
16. Math object method used to return the square root of a given number
var dateObject = new Date("11/22/2012 18:25:35")
Math.pow(number, power)
r
Math.sqrt(number)
17. To insert Javascript into a web page
<script type="text/javascript">.....</script>
Math.sqrt(number)
toTimeString()
toDateString()
18. To display an alert
t
alert("Alert Text Here")
document.getElementById("TextBoxId").disabled = true;
Math.max(var1, var2, varN)
19. To create a function in JavaScript
<noscript>
var functionName = function(param1, param2, paramN) {}
toUpperCase()
toExponential(digits)
20. Number object method used to return a numerical string with the specified number of significant digits
document.getElementById("spanId").firstChild.nodeValue = "New Value";
document.getElementById("textAreaId").value = "Text Value";
toPrecision(precision)
toFixed(digits)
21. To denote a string in JavaScript
document.getElementById("checkboxId").value;
sensitive
Either single or double quotes surrounding the data
while (condition) {}
22. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
Math.round(number)
toUpperCase()
setMilliseconds()
getFullYear()
23. To assign the return value of confirm() to a variable
===
var answerVar = confirm("Message Text Here")
document.getElementById("TextBoxId").focus;
Math.random() //Returns a value >= 0.0 but <1.0
24. To create an Array object in JavaScript
sensitive
document.getElementById("checkboxId").value;
window.location = "New Web Address Here";
var arrayVar = new Array()
25. JavaScript is case _______
sensitive
Math.max(var1, var2, varN)
Src - e.g. <script src="fileName.js"> //
!==
26. Statements end in JavaScript with a ________
Math.floor(number)
semicolon ";"
document.writeln("Text Here") //Advances to new line after text
charAt(position)
27. The format to create a new Date object from a string
var functionName = function(param1, param2, paramN) {}
event handler .
var dateObject = new Date("11/22/2012 18:25:35")
t
28. A _______ variable can be changed and accessed from within and without a function or object.
toLowerCase()
global
var functionName = function(param1, param2, paramN) {}
===
29. To assign the value from a prompt to a non-string variable
document.getElementById("spanId").firstChild.nodeValue = "New Value";
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
document.getElementById("TextBoxId").disabled = true;
Math.ceil(number)
30. To write a line to the current element of the DOM (Document Object Model)
substring(startIndex, stopIndex)
Either single or double quotes surrounding the data
document.writeln("Text Here") //Advances to new line after text
focus
31. To code a while statement in JavaScript
var functionName = function(param1, param2, paramN) {}
document.getElementById("radioButtonId").checked;
document.getElementById("textAreaId").value;
while (condition) {}
32. String object method used to return a new string that contains part of the original string from the specified start position
substring(startIndex)
document.getElementById("TextBoxId").value;
toExponential(digits)
sensitive
33. To get the text value of the control for radio buttons
var functionName = function(param1, param2, paramN) {}
document.getElementById("radioButtonId").value;
standard equality operators
toTimeString()
34. The events common to most controls: onfocus - onblur - onclick - _______ - onchange - onselect
document.getElementById("spanId").firstChild.nodeValue = "New Value";
ondblclick
Math.ceil(number)
Math.pow(number, power)
35. To set the control to be disabled for textboxes
toDateString()
document.getElementById("TextBoxId").disabled = true;
confirm()
toString(base)
36. To set the current checked status of the control for checkboxes
document.getElementById("checkboxId").checked;
t
Math.min(var1, var2, varN)
document.getElementById("CheckboxId").checked = true; //Could also be false
37. To get the current checked status of the control for radio buttons
Math.abs(number)
t
document.getElementById("radioButtonId").checked;
semicolon ";"
38. To declare a variable in JavaScript
var variableName;
semicolon ";"
var functionName = function(param1, param2, paramN) {}
string
39. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
var variableName;
<noscript>
confirm()
confirm("Message Text Here")
40. String object method used to return the position of the first instance of a specified search string starting from the specified index
window.location = "New Web Address Here";
document.getElementById("TextBoxId").value;
v
indexOf(searchValue, startPosition)
41. The string escape sequence to start a new line in JavaScript
n
var functionName = function(param1, param2, paramN) {}
alert("Alert Text Here")
r
42. Math object method used to return the highest value from a set of supplied numbers
Math.max(var1, var2, varN)
document.getElementById("spanId").firstChild;
Math.min(var1, var2, varN)
Math.sqrt(number)
43. To set focus on the control for textboxes
var functionName = function(param1, param2, paramN) {}
document.getElementById("TextBoxId").focus;
document.getElementById("CheckboxId").checked = true; //Could also be false
document.writeln("Text Here") //Advances to new line after text
44. Math object method used to return the absolute value of a given number
toString(base)
Two forward slashes "//"
sensitive
Math.abs(number)
45. The string escape sequence to insert a form feed in JavaScript
v
f
Math.floor(number)
semicolon ";"
46. To make the browser load a new page using JavaScript
redeclare
window.location = "New Web Address Here";
for (counter; condition; incrementor) {}
(Condition_Expression) ? Value_If_True : Value_If_False;
47. To create a single line comment in JavaScript
Two forward slashes "//"
document.getElementById("checkboxId").checked;
Math.min(var1, var2, varN)
var stringVar = prompt("Text Here")
48. To create a function that returns a value in JavaScript
var functionName = function(param1, param2, paramN) {}
document.getElementById("TextBoxId").disabled = true;
var answerVar = confirm("Message Text Here")
document.getElementById("checkboxId").checked;
49. The syntax of a conditional operator
setMilliseconds()
var functionName = function(param1, param2, paramN) {}
Src - e.g. <script src="fileName.js"> //
(Condition_Expression) ? Value_If_True : Value_If_False;
50. Date object method used to return a string containing the date and time
expression
toString()
isNaN(varHere) //Returns true or false.
!==