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
25
questions in
10 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 valid characters for an identifier in JavaScript: Letters - Numbers - ________ and Dollar Signs
while (condition) {}
Underscores
Use a parse. Example : var intVar = parseInt(prompt("Text Here"))
Src - e.g. <script src="fileName.js"> //
2. Math object method used to return a random number
Math.floor(number)
document.getElementById("spanId").firstChild;
Math.random() //Returns a value >= 0.0 but <1.0
Math.max(var1, var2, varN)
3. To code an If statement in JavaScript
getTime()
concat(var1, var2, varN)
if (condition) {}
ondblclick
4. To code a while statement in JavaScript
!==
while (condition) {}
<noscript>
semicolon ";"
5. Command to display a prompt
r
global
prompt("Text Here")
document.getElementById("ButtonId").onclick = functionName;
6. The string escape sequence to start a new line in JavaScript
document.getElementById("TextBoxId").disabled = true;
Either single or double quotes surrounding the data
Math.abs(number)
n
7. To test that a variable contains a valid number
event handler .
substring(startIndex)
indexOf(searchValue, startPosition)
isNaN(varHere) //Returns true or false.
8. The string escape sequence to insert a single quote in JavaScript
9. To create a function in JavaScript
'
var dateObject = new Date("11/22/2012 18:25:35")
var functionName = function(param1, param2, paramN) {}
r
10. To display a confirmation
confirm("Message Text Here")
Math.min(var1, var2, varN)
Math.abs(number)
var answerVar = confirm("Message Text Here")
11. To create a function that returns a value in JavaScript
'
var functionName = function(param1, param2, paramN) {}
Math.round(number)
document.getElementById("TextBoxId").value;
12. To code a for statement in JavaScript
Charset
for (counter; condition; incrementor) {}
document.getElementById("radioButtonId").checked;
toUpperCase()
13. The string escape sequence to insert a tab in JavaScript
t
alert("Alert Text Here")
Two forward slashes "//"
confirm("Message Text Here")
14. To get the value or the currently selected item for lists
focus
Math.abs(number)
document.getElementById("TextBoxId").focus;
document.getElementById("listId").value;
15. Math object method used to return the absolute value of a given number
string
!==
Math.abs(number)
document.getElementById("radioButtonId").checked = true; //Could also be false
16. Math object method used to return a given number raised to a given power
toFixed(digits)
Math.pow(number, power)
document.writeln("Text Here") //Advances to new line after text
prompt("Text Here")
17. To alter the value of the text element in a span tag
document.getElementById("spanId").firstChild.nodeValue = "New Value";
substring(startIndex)
getTime()
(Condition_Expression) ? Value_If_True : Value_If_False;
18. This returns only True or false values
confirm()
var stringVar = "part 1:" + "part 2";
toDateString()
var answerVar = confirm("Message Text Here")
19. To get the current value for textboxes
document.getElementById("checkboxId").value;
document.getElementById("TextBoxId").value;
var dateVar = new Date()
toString(base)
20. To get the current checked status of the control for radio buttons
Math.max(var1, var2, varN)
<script type="text/javascript">.....</script>
document.getElementById("radioButtonId").checked;
window.location = "New Web Address Here";
21. The syntax of a conditional operator
===
(Condition_Expression) ? Value_If_True : Value_If_False;
document.getElementById("CheckboxId").checked = true; //Could also be false
getFullYear()
22. The two methods common to most controls: ______ //Brings focus to the control blur //Removes focus from the control
toString(base)
getFullYear()
Math.random() //Returns a value >= 0.0 but <1.0
focus
23. The identity operator for equals
===
string
v
document.getElementById("TextBoxId").value;
24. A _______ variable can be changed and accessed from within and without a function or object.
Math.ceil(number)
for (counter; condition; incrementor) {}
Multi line
global
25. To code a button.onclick event handler
Charset
r
document.getElementById("TextBoxId").focus;
document.getElementById("ButtonId").onclick = functionName;