0% found this document useful (0 votes)
23 views6 pages

JavaScript Question Bank and Exercises

The document is a JavaScript question bank containing a series of questions and multiple-choice answers covering various topics related to JavaScript, including syntax, functions, and DOM manipulation. It also includes practical exam tasks for designing applications that perform specific operations based on user input. The questions range from basic definitions to more complex programming concepts and practices.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views6 pages

JavaScript Question Bank and Exercises

The document is a JavaScript question bank containing a series of questions and multiple-choice answers covering various topics related to JavaScript, including syntax, functions, and DOM manipulation. It also includes practical exam tasks for designing applications that perform specific operations based on user input. The questions range from basic definitions to more complex programming concepts and practices.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

JAVASCRIPT QUESTION BANK

Questions:
What is Javascript?
2. Who invented Javascript?
3. Does an interpreter work for reading or editing Javascript?
4. What is the difference between JScript and JavaScript?

5. Can JavaScript syntax be introduced in an external document?


6. What is the HTML tag to display a notice to browsers that do not support Javascript?
7. How are comments introduced in Javascript syntax?
8. What is onBlur?
9. What can you do with OnMouseOver?
10. Which of the following attributes is not a property of the frame object?
11. To display a message on the screen, the following instruction is usually used:
a. (popup, ("Esto es un mensaje")
b. show("This is a message")
c. alert("This is a message")
d. msgBox("This is a message")
12. How do you open a new window in the browser?
a. [Link]("[Link]
b. [Link]("[Link]
c. [Link]("[Link]
d. [Link]("[Link]
13. In JavaScript, how do you put a message in the browser's status bar?
[Link]("the message")
[Link]("the message")
[Link] = "the message"
[Link] = "the message"
14. In JavaScript, to obtain the length of the string 'cad', the method used is
a) strlen(cad)
b) len(string)

c) [Link]
d) The previous answers are not correct
15. In JavaScript, how is the maximum of the numbers 2 and 4 calculated?
a) ceil(2, 4)
top(2, 4)
c) [Link](2, 4)
d) [Link](2, 4)
16. DOM is the acronym for
a) Document Object Markup
b) Document Of Model
c) Domain Object Model
d) The previous answers are not correct
17. The standardization of JavaScript is carried out by
a) ECMA
b) Mozilla
c) The Script Consortium
W3C
18. Regarding the end of instruction in JavaScript
a) The semicolon (;) is used and is mandatory
b) The semicolon (;) is used, but it is optional.
c) No delimiter is used
d) The previous answers are not correct.
19. In JavaScript, what does the continue statement do?
a) Finalizes the execution of the current method

b) Ends the execution of the code


c) Skip to the next iteration in the current for, while, or do-while loop
d) Ends the execution of the current for, while, or do-while loop
20. In the DOM, to visit the next sibling node, you use
brother
b) next
nextBrother
d) The previous answers are not correct
21. Regarding web browsers, the BOM is the
a) Byte Object Model
b) Browser Object Model
c) Binary Object Model
d) The previous answers are not correct.
22. Which of the following statements about arrays in JavaScript is false?
a) The elements can have different types
b) Multidimensional arrays cannot be created
c) The index can be a string or an integer
d) Brackets are used to indicate the positions in the array
23. In the DOM, to add a child element, the method is used
a) appendChild()
createChild()
newChild()
d) The previous answers are not correct
24. In JavaScript, how do you open a new browser window?
a) [Link]("[Link]")
[Link]('[Link]')
c) [Link]("[Link]")
[Link]("[Link]")
25. What is JSON?
a) An object-oriented programming language based on JavaScript
b) A server based on JavaScript
a lightweight format for data interchange used in JavaScript
d) The previous answers are not correct
26. JavaScript was designed by
a) Bill Gates
Bjarne Stroustrup
c) Brendan Eich
d) Dennis M. Ritchie
27. In JavaScript, how do you insert a comment that takes up one line?
a) <!-- Comment -->
b) // Comment
c) ' Comment
d) The previous answers are not correct
28. In the DOM, to obtain the textual content of a part of the page, the property is used
a) content
b) text
c) textContent
value
29. In an XHTML page, what is the correct way to reference an external file with code
JavaScript called "[Link]"?
<script name="[Link]" type="text/javascript" />
<script src="[Link]" type="text/javascript"></script>
c) <script src="[Link]" type="text/javascript" />
d) Las anteriores respuestas no son correctas
30. In JavaScript, to obtain a specific character from a string according to its position, the is used.
function
a) char()
b) charAt()
c) value()
d) The previous answers are not correct
31. In JavaScript, what is the name of the method that checks a regular expression and returns the string?
What is the date of her birthday?

check()
b) exec()
c) run()
d) test()
32. In JavaScript, how do you write a 'for' loop to count from 1 to 5?
a) for(i = 1; i <= 5; i++)
b) for(i <= 5; i++)
c) for i = 1 to 5
d) The previous answers are not correct
33. In JavaScript, what does the break statement do?
a) Finalizes the execution of the current method

b) Finalize the execution of the code


c) Skip to the next iteration in the current for, while, or do-while loop
d) Ends the execution of the current for, while or do-while loop
34. In JavaScript, to end a 'for' loop, you use
a) It cannot be
b) Exit for
c) break
d) The previous answers are not correct.
35. What function exists in the DOM?
getElementsById()
b) getElementByName()
c) getElementsByTagName()
d) The previous answers are not correct
36. In JavaScript, how to get the version of the browser?
a) [Link]
b) [Link]
c) [Link]
d) [Link]
37. In the DOM, to remove a child element the method is used
a) deleteChild()
b) dropChild()
c) removeChild()
d) The previous answers are not correct
38. The company that invented the JavaScript language was
Mozilla
b) Netscape
Sun
d) The previous answers are not correct.
39. In JavaScript, what is the correct way to create an array?
a) var txt = new Array:1=("tim"),2=("kim"),3=("jim")
b) var txt = new Array(1="tim",2="kim",3="jim")
c) var txt = new Array("tim","kim","jim")
d) var txt = new Array(1:"tim",2:"kim",3:"jim")
40. In JavaScript, how can you navigate to the previous page in the browsing history?
a) [Link](-1)
b) [Link]()
c) [Link]()
d) [Link]()
41. The name of a variable can start with a numeric character (digit).
a. True
b. False
42. Which of these operators is used to concatenate strings?
a. %
b. $
c. +
. .
43. The limit for naming variables is 8 characters.
a. True
b. False
44. When you declare variables in Javascript the following reserved word is used:
a. DIM
b. PUBLIC
c. VAR
d. STORE
45. If the following expression was evaluated: ( 4 == '4') the result is:

a. True
b. False
46. What is the result of: (3%2)?
a. 3
b. 1
c. 1.5
d. 2
47. To display a message on the screen, the following instruction is usually used:
This is a message
show("This is a message")
g. alert("Esto es un mensaje")
h. msgBox("This is a message")

Practical Exam:

Design applications:

1. The application must request the input of an integer, greater than zero and less than seven. As
the result should print the factorial of the registered number.
2. The application must request the registration of any number. As a result, it should display the table of
multiply from one to twelve by the registered number.
3. Aplicación que permita ingresar cualquier número. Como resultado demostrar si el número es par o
odd.
4. An application that allows requesting three numbers and a basic mathematical operator (+, -, *, /). Show
as a result of the operation of the numbers registered according to the operator.

You might also like