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. When you add a string and a number the result will be a ____
confirm()
Either single or double quotes surrounding the data
string
"
2. The escape sequence used to insert a Unicode character into a string in JavaScript
udddd
event handler .
concat(var1, var2, varN)
var dateObject = new Date(year, month, day, hours, minutes, seconds, milliseconds)
3. A function that is called with a certain event occurs - e.g. button.onclick and window.onload.
event handler .
sensitive
Math.floor(number)
isNaN(varHere) //Returns true or false.
4. To test that a variable contains a valid number
document.getElementById("CheckboxId").checked = true; //Could also be false
isNaN(varHere) //Returns true or false.
document.getElementById("checkboxId").value;
getFullYear()
5. Number object method used to return a number in exponential format with the specified number of decimal places
document.getElementById("checkboxId").checked;
Math.round(number)
toExponential(digits)
event handler .
6. Date object method used to return a string containing the date
semicolon ";"
Math.ceil(number)
charAt(position)
toDateString()
7. Date object method used to return a string containing the date and time
Charset
document.getElementById("ButtonId").onclick = functionName;
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
toString()
8. Math object method used to return a given number rounded to the next lowest integer value
Math.abs(number)
Math.floor(number)
var functionName = function(param1, param2, paramN) {}
toString()
9. The string escape sequence to insert a vertical tab in JavaScript
while (condition) {}
var dateVar = new Date()
v
document.getElementById("TextBoxId").focus;
10. A _______ variable can be changed and accessed from within and without a function or object.
substring(startIndex, stopIndex)
(Condition_Expression) ? Value_If_True : Value_If_False;
global
redeclare
11. Math object method used to return a given number that has been rounded to the closes integer value
getFullYear()
toFixed(digitCount)
Math.round(number)
confirm()
12. To code a for statement in JavaScript
document.getElementById("radioButtonId").checked;
for (counter; condition; incrementor) {}
Two forward slashes "//"
document.getElementById("radioButtonId").checked = true; //Could also be false
13. The available set methods for a Date object: setFullYear() - setMonth() - setDate() - setHours() - setMinutes() - setSeconds() - _________
setMilliseconds()
r
document.getElementById("spanId").firstChild.nodeValue = "New Value";
Underscores
14. To create a Date object in JavaScript
var stringVar = prompt("Text Here")
===
isNaN(varHere) //Returns true or false.
var dateVar = new Date()
15. ________ comments start with / and end with /.
semicolon ";"
getFullYear()
Multi line
substring(startIndex)
16. The available properties for the Number object: Number.MAX_VALUE - Number.MIN_VALUE - Number.POSITIVE_INFINITY - _______ - Number.NaN
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
substring(startIndex, stopIndex)
Number.NEGATIVE_INFINITY
Src - e.g. <script src="fileName.js"> //
17. The identity operator for not equal
document.getElementById("TextBoxId").value;
!==
toLowerCase()
Math.random() //Returns a value >= 0.0 but <1.0
18. The string escape sequence to insert a carriage return in JavaScript
r
"
substring(startIndex, stopIndex)
expression
19. String object method used to get the character at a specified index position
document.getElementById("TextBoxId").value;
charAt(position)
Two forward slashes "//"
prompt("Text Here")
20. To display an alert
document.getElementById("TextBoxId").disabled = true;
charAt(position)
Underscores
alert("Alert Text Here")
21. To get the current checked status of the control for checkboxes
r
standard equality operators
document.writeln("Text Here") //Advances to new line after text
document.getElementById("checkboxId").checked;
22. This returns only True or false values
document.getElementById("listId").value;
confirm()
getFullYear()
Math.sqrt(number)
23. The available get methods for a Date object: getTime() - _________ - getMonth() - getDate() - getHours() - getMinutes() - getSeconds() - getMilliseconds()
var stringVar = prompt("Text Here")
string
f
getFullYear()
24. Date object method used to return a string containing the time
document.getElementById(id)
expression
toFixed(digitCount)
toTimeString()
25. To assign a default value to a prompt
Use the second parameter. Example: prompt("Enter Age:", "18")
t
var functionName = function(param1, param2, paramN) {}
confirm("Message Text Here")
26. To get the value or the currently selected item for lists
document.getElementById("spanId").firstChild;
Math.abs(number)
var arrayVar = new Array()
document.getElementById("listId").value;
27. To create a function in JavaScript
<script type="text/javascript">.....</script>
toPrecision(precision)
confirm("Message Text Here")
var functionName = function(param1, param2, paramN) {}
28. Number object method used to return a numerical string with the specified number of significant digits
var functionName = function(param1, param2, paramN) {}
(Condition_Expression) ? Value_If_True : Value_If_False;
Math.max(var1, var2, varN)
toPrecision(precision)
29. To set the control to be disabled for textboxes
Underscores
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Multi line
document.getElementById("TextBoxId").disabled = true;
30. To assign the value from a prompt to a string
event handler .
var stringVar = prompt("Text Here")
Number.NEGATIVE_INFINITY
'
31. To assign the return value of confirm() to a variable
window.onload = function() {//actions here}
'
var answerVar = confirm("Message Text Here")
var variableName;
32. To set focus on the control for textboxes
standard equality operators
document.getElementById("TextBoxId").focus;
sensitive
document.getElementById("textAreaId").value;
33. To assign actions to the window onLoad event
window.location()
toLowerCase()
window.onload = function() {//actions here}
document.getElementById("textAreaId").value;
34. To denote a string in JavaScript
document.getElementById("checkboxId").value;
Either single or double quotes surrounding the data
document.getElementById("TextBoxId").disabled = true;
t
35. 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
document.getElementById("TextBoxId").value;
document.getElementById("TextBoxId").disabled = true;
toTimeString()
substring(startIndex, stopIndex)
36. To write a line to the current element of the DOM (Document Object Model)
var stringVar = "part 1:" + "part 2";
<script type="text/javascript">.....</script>
document.writeln("Text Here") //Advances to new line after text
substring(startIndex)
37. To set the digit precision of a decimal number
var arrayVar = new Array()
toFixed(digitCount)
Number.NEGATIVE_INFINITY
Math.random() //Returns a value >= 0.0 but <1.0
38. To insert Javascript into a web page
window.location = "New Web Address Here";
toString()
!==
<script type="text/javascript">.....</script>
39. The events common to most controls: onfocus - onblur - onclick - _______ - onchange - onselect
Math.abs(number)
ondblclick
toFixed(digits)
!==
40. The string escape sequence to insert a backslash in JavaScript
document.write("Text Here") //Remains on current line
\
confirm("Message Text Here")
document.getElementById("spanId").firstChild.nodeValue = "New Value";
41. What String object method returns a new string containing the value of the original string but in all upper case
sensitive
string
toUpperCase()
Underscores
42. To concatenate multiple parts into a string
===
var stringVar = "part 1:" + "part 2";
ondblclick
document.getElementById("TextBoxId").focus;
43. What String object method returns a new string containing the value of the original string but in all lower case
setMilliseconds()
\
redeclare
toLowerCase()
44. Number object method used to return a string with a given number base
document.getElementById("radioButtonId").checked = true; //Could also be false
toString(base)
substring(startIndex, stopIndex)
var stringVar = "part 1:" + "part 2";
45. Math object method used to return the lowest value for a set of supplied numbers
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
confirm()
Charset
Math.min(var1, var2, varN)
46. String object method used to concatenate multiple strings
focus
string
var functionName = function(param1, param2, paramN) {}
concat(var1, var2, varN)
47. To write text to the current element of the DOM
semicolon ";"
\
document.write("Text Here") //Remains on current line
standard equality operators
48. To get the text value of the control for radio buttons
<noscript>
document.getElementById("checkboxId").checked;
window.onload = function() {//actions here}
document.getElementById("radioButtonId").value;
49. To get the current checked status of the control for radio buttons
document.getElementById("radioButtonId").checked;
Math.sqrt(number)
ondblclick
confirm()
50. To create a function that returns a value in JavaScript
confirm()
var functionName = function(param1, param2, paramN) {}
substring(startIndex, stopIndex)
concat(var1, var2, varN)