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. String object method used to concatenate multiple strings
global
t
concat(var1, var2, varN)
Charset
2. To make the browser load a new page using JavaScript
window.location = "New Web Address Here";
r
document.getElementById("TextBoxId").value;
var stringVar = prompt("Text Here")
3. Math object method used to return the absolute value of a given number
setMilliseconds()
Math.sqrt(number)
document.getElementById("CheckboxId").checked = true; //Could also be false
Math.abs(number)
4. When you __________ a javascript variable it retains its original value
ondblclick
redeclare
toTimeString()
document.getElementById("radioButtonId").value;
5. A list-like construct that has properties which corresponds to JavaScript values or variables or other objects.
window.location()
redeclare
Objects
document.write("Text Here") //Remains on current line
6. To assign a default value to a prompt
document.getElementById("textAreaId").value;
toUpperCase()
var variableName;
Use the second parameter. Example: prompt("Enter Age:", "18")
7. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
event handler .
string
udddd
toFixed(digitCount)
8. A _______ variable can be changed and accessed from within and without a function or object.
Two forward slashes "//"
global
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
\
9. This returns only True or false values
document.getElementById("checkboxId").value;
confirm()
toUpperCase()
document.getElementById("radioButtonId").checked = true; //Could also be false
10. A statement that yields a value
Math.max(var1, var2, varN)
var stringVar = prompt("Text Here")
var answerVar = confirm("Message Text Here")
expression
11. To code an If statement in JavaScript
expression
t
if (condition) {}
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
12. When you add a string and a number the result will be a ____
document.getElementById("TextBoxId").focus;
window.location = "New Web Address Here";
string
charAt(position)
13. To concatenate multiple parts into a string
document.getElementById("textAreaId").value = "Text Value";
Math.floor(number)
var stringVar = "part 1:" + "part 2";
document.getElementById("TextBoxId").value;
14. String object method used to return a new string that contains part of the original string from the specified start position
var dateObject = new Date("11/22/2012 18:25:35")
if (condition) {}
substring(startIndex)
toExponential(digits)
15. 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)
document.write("Text Here") //Remains on current line
document.getElementById("radioButtonId").checked = true; //Could also be false
var dateVar = new Date()
16. To access a page element by id
var functionName = function(param1, param2, paramN) {}
redeclare
window.location()
document.getElementById(id)
17. 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
18. To create a function in JavaScript
document.getElementById("textAreaId").value;
semicolon ";"
var functionName = function(param1, param2, paramN) {}
toTimeString()
19. The format to create a new Date object from a string
toFixed(digitCount)
var dateObject = new Date("11/22/2012 18:25:35")
while (condition) {}
f
20. Unlike ________________ identity operators do not perform type coercion.
Two forward slashes "//"
document.getElementById("spanId").firstChild;
standard equality operators
document.getElementById("spanId").firstChild.nodeValue = "New Value";
21. To get the current value for textboxes
getFullYear()
===
'
document.getElementById("TextBoxId").value;
22. To get the text value of the control for radio buttons
document.getElementById("radioButtonId").value;
f
Math.random() //Returns a value >= 0.0 but <1.0
redeclare
23. Math object method used to return a given number raised to a given power
Math.pow(number, power)
event handler .
(Condition_Expression) ? Value_If_True : Value_If_False;
substring(startIndex, stopIndex)
24. The ________ tag is used to display the text between the opening and closing tag if JavaScript is disabled or otherwise not available
<noscript>
if (condition) {}
"
document.getElementById(id)
25. The identity operator for equals
===
'
var functionName = function(param1, param2, paramN) {}
setMilliseconds()
26. To write a line to the current element of the DOM (Document Object Model)
toLowerCase()
document.getElementById("listId").value;
document.writeln("Text Here") //Advances to new line after text
var stringVar = prompt("Text Here")
27. String object method used to get the character at a specified index position
charAt(position)
document.getElementById("listId").value;
document.getElementById("radioButtonId").checked;
Math.pow(number, power)
28. To set the current checked status of the control for radio buttons
document.getElementById("radioButtonId").checked = true; //Could also be false
Math.ceil(number)
global
string
29. Date object method used to return a string containing the time
toTimeString()
substring(startIndex)
expression
Number.NEGATIVE_INFINITY
30. To access the text element in a <span> tag
toFixed(digits)
document.getElementById("spanId").firstChild;
Math.round(number)
var dateVar = new Date()
31. To write text to the current element of the DOM
isNaN(varHere) //Returns true or false.
(Condition_Expression) ? Value_If_True : Value_If_False;
document.write("Text Here") //Remains on current line
document.writeln("Text Here") //Advances to new line after text
32. The escape sequence used to insert a Unicode character into a string in JavaScript
var functionName = function(param1, param2, paramN) {}
===
udddd
getTime()
33. Date object method used to return a string containing the date
document.getElementById("textAreaId").value = "Text Value";
toTimeString()
toDateString()
global
34. To set the control to be disabled for textboxes
confirm("Message Text Here")
document.getElementById("TextBoxId").disabled = true;
===
toExponential(digits)
35. Math object method used to return the highest value from a set of supplied numbers
t
Math.max(var1, var2, varN)
r
Math.ceil(number)
36. Number object method used to round numbers to the specified number of decimal places
toFixed(digits)
prompt("Text Here")
"
Math.pow(number, power)
37. The string escape sequence to insert a double quote in JavaScript
ondblclick
"
Math.random() //Returns a value >= 0.0 but <1.0
Multi line
38. To set the current value of the control for a text area
toFixed(digits)
document.getElementById("textAreaId").value = "Text Value";
if (condition) {}
var arrayVar = new Array()
39. The string escape sequence to insert a carriage return in JavaScript
r
setMilliseconds()
toTimeString()
var arrayVar = new Array()
40. To set the digit precision of a decimal number
<script type="text/javascript">.....</script>
var stringVar = "part 1:" + "part 2";
toDateString()
toFixed(digitCount)
41. To create a new Date object
Underscores
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
Math.round(number)
Use the second parameter. Example: prompt("Enter Age:", "18")
42. Number object method used to return a numerical string with the specified number of significant digits
setMilliseconds()
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
Charset
toPrecision(precision)
43. Math object method used to return a random number
===
Math.random() //Returns a value >= 0.0 but <1.0
sensitive
confirm()
44. The identity operator for not equal
var arrayVar = new Array()
!==
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
45. Date object method used to return a string containing the date and time
document.getElementById("CheckboxId").checked = true; //Could also be false
Two forward slashes "//"
if (condition) {}
toString()
46. To denote a string in JavaScript
document.getElementById("CheckboxId").checked = true; //Could also be false
\
Either single or double quotes surrounding the data
n
47. Math object method used to return the square root of a given number
Math.sqrt(number)
!==
toExponential(digits)
f
48. To code a while statement in JavaScript
toString(base)
Math.max(var1, var2, varN)
while (condition) {}
document.getElementById("listId").value;
49. JavaScript is case _______
getTime()
sensitive
charAt(position)
document.getElementById("textAreaId").value = "Text Value";
50. The syntax of a conditional operator
Number.NEGATIVE_INFINITY
f
toExponential(digits)
(Condition_Expression) ? Value_If_True : Value_If_False;