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 declare a variable in JavaScript
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
var variableName;
Math.pow(number, power)
<noscript>
2. The string escape sequence to insert a tab in JavaScript
document.getElementById("listId").value;
t
<noscript>
confirm()
3. To set the control to be disabled for textboxes
confirm()
document.getElementById("TextBoxId").disabled = true;
window.onload = function() {//actions here}
document.getElementById("spanId").firstChild;
4. To display a confirmation
r
sensitive
confirm("Message Text Here")
toString()
5. The string escape sequence to start a new line in JavaScript
Math.abs(number)
substring(startIndex)
for (counter; condition; incrementor) {}
n
6. The string escape sequence to insert a backslash in JavaScript
\
Math.max(var1, var2, varN)
Two forward slashes "//"
Math.random() //Returns a value >= 0.0 but <1.0
7. To set the current checked status of the control for checkboxes
prompt("Text Here")
document.getElementById("CheckboxId").checked = true; //Could also be false
===
Either single or double quotes surrounding the data
8. To concatenate multiple parts into a string
var stringVar = "part 1:" + "part 2";
(Condition_Expression) ? Value_If_True : Value_If_False;
redeclare
document.getElementById("radioButtonId").checked = true; //Could also be false
9. To code an If statement in JavaScript
if (condition) {}
for (counter; condition; incrementor) {}
document.getElementById("textAreaId").value;
var dateVar = new Date()
10. Date object method used to return a string containing the date and time
toExponential(digits)
substring(startIndex)
toString()
Math.pow(number, power)
11. Number object method used to return a string with a given number base
Math.pow(number, power)
<noscript>
toString(base)
document.getElementById("TextBoxId").focus;
12. 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)
isNaN(varHere) //Returns true or false.
ondblclick
prompt("Text Here")
13. Math object method used to return a given number raised to a given power
var functionName = function(param1, param2, paramN) {}
Math.pow(number, power)
toFixed(digitCount)
document.getElementById("spanId").firstChild;
14. Math object method used to return a given number that has been rounded to the closes integer value
var functionName = function(param1, param2, paramN) {}
setMilliseconds()
var answerVar = confirm("Message Text Here")
Math.round(number)
15. To assign a default value to a prompt
Math.min(var1, var2, varN)
Use the second parameter. Example: prompt("Enter Age:", "18")
expression
document.getElementById("TextBoxId").value;
16. To alter the value of the text element in a span tag
document.getElementById("TextBoxId").disabled = true;
Underscores
document.getElementById("listId").value;
document.getElementById("spanId").firstChild.nodeValue = "New Value";
17. To get the value or the currently selected item for lists
document.getElementById("listId").value;
alert("Alert Text Here")
expression
toFixed(digits)
18. To set the current value of the control for a text area
getFullYear()
toFixed(digits)
document.getElementById("textAreaId").value = "Text Value";
while (condition) {}
19. The four attributes of the <script> tag:Type - Src - _____ and Defer
Math.ceil(number)
Charset
toFixed(digitCount)
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
20. The string escape sequence to insert a carriage return in JavaScript
r
document.getElementById("spanId").firstChild.nodeValue = "New Value";
Src - e.g. <script src="fileName.js"> //
Math.round(number)
21. Math object method used to return the lowest value for a set of supplied numbers
document.getElementById("spanId").firstChild.nodeValue = "New Value";
Math.min(var1, var2, varN)
confirm("Message Text Here")
Multi line
22. To get the current value of the control for a text area
Math.max(var1, var2, varN)
semicolon ";"
document.getElementById("textAreaId").value;
"
23. The string escape sequence to insert a double quote in JavaScript
t
Math.sqrt(number)
document.writeln("Text Here") //Advances to new line after text
"
24. To set focus on the control for textboxes
document.getElementById("TextBoxId").focus;
standard equality operators
toUpperCase()
document.getElementById("radioButtonId").checked = true; //Could also be false
25. To get the current value for textboxes
document.getElementById("ButtonId").onclick = functionName;
redeclare
global
document.getElementById("TextBoxId").value;
26. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
event handler .
document.getElementById("TextBoxId").value;
Math.abs(number)
toLowerCase()
27. Statements end in JavaScript with a ________
udddd
v
semicolon ";"
ondblclick
28. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
Number.NEGATIVE_INFINITY
document.getElementById("checkboxId").checked;
semicolon ";"
getFullYear()
29. JavaScript is case _______
sensitive
t
if (condition) {}
Math.ceil(number)
30. String object method used to concatenate multiple strings
alert("Alert Text Here")
var dateObject = new Date("11/22/2012 18:25:35")
concat(var1, var2, varN)
Math.random() //Returns a value >= 0.0 but <1.0
31. To set the digit precision of a decimal number
toFixed(digitCount)
event handler .
prompt("Text Here")
Math.pow(number, power)
32. To assign the value from a prompt to a string
document.getElementById("ButtonId").onclick = functionName;
toString(base)
var stringVar = prompt("Text Here")
document.getElementById("textAreaId").value;
33. Math object method used to return the square root of a given number
document.write("Text Here") //Remains on current line
document.getElementById("spanId").firstChild.nodeValue = "New Value";
document.getElementById("TextBoxId").value;
Math.sqrt(number)
34. To view the current web address using JavaScript
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
alert("Alert Text Here")
===
window.location()
35. To insert Javascript into a web page
if (condition) {}
Math.min(var1, var2, varN)
<script type="text/javascript">.....</script>
Either single or double quotes surrounding the data
36. To create an Array object in JavaScript
var arrayVar = new Array()
var stringVar = "part 1:" + "part 2";
Math.abs(number)
document.getElementById(id)
37. Math object method used to return the absolute value of a given number
Math.abs(number)
event handler .
Underscores
Math.ceil(number)
38. Math object method used to return a given number rounded to the next highest integer value
Math.ceil(number)
document.getElementById("TextBoxId").focus;
document.writeln("Text Here") //Advances to new line after text
Math.pow(number, power)
39. To assign actions to the window onLoad event
Charset
Math.ceil(number)
n
window.onload = function() {//actions here}
40. ________ comments start with / and end with /.
charAt(position)
document.getElementById("TextBoxId").focus;
Number.NEGATIVE_INFINITY
Multi line
41. The _____ attribute is used to denote external file for script use
Charset
Either single or double quotes surrounding the data
Src - e.g. <script src="fileName.js"> //
Math.ceil(number)
42. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
focus
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
string
var answerVar = confirm("Message Text Here")
43. The format to create a new Date object from a string
Math.pow(number, power)
var dateObject = new Date("11/22/2012 18:25:35")
toString()
var functionName = function(param1, param2, paramN) {}
44. Math object method used to return the highest value from a set of supplied numbers
Math.max(var1, var2, varN)
concat(var1, var2, varN)
Underscores
alert("Alert Text Here")
45. Unlike ________________ identity operators do not perform type coercion.
standard equality operators
toFixed(digitCount)
document.getElementById("CheckboxId").checked = true; //Could also be false
window.location()
46. The string escape sequence to insert a vertical tab in JavaScript
Either single or double quotes surrounding the data
(Condition_Expression) ? Value_If_True : Value_If_False;
v
document.getElementById("textAreaId").value;
47. What String object method returns a new string containing the value of the original string but in all lower case
toLowerCase()
document.getElementById("textAreaId").value;
document.getElementById("CheckboxId").checked = true; //Could also be false
Math.pow(number, power)
48. 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
49. This returns only True or false values
toExponential(digits)
toUpperCase()
ondblclick
confirm()
50. To create a single line comment in JavaScript
concat(var1, var2, varN)
window.onload = function() {//actions here}
Two forward slashes "//"
Use the second parameter. Example: prompt("Enter Age:", "18")