JavaScript Questions & Answers – Forms of Debugging

«
»

This set of Javascript Multiple Choice Questions & Answers (MCQs) focuses on “Forms of Debugging”.

1. What is it called when we make a mistake in the script?
a) Error
b) Bug
c) Mistake
d) Debug
View Answer

Answer: b
Explanation: A bug in a programming language refers to a set of code which results in an error in compilation. A mistake in a script is referred to as a bug.
advertisement

2. Which of the following is the definition for debugging?
a) Finding bugs
b) Fixing bugs
c) Both Finding & Fixing bugs
d) Clearing bugs
View Answer

Answer: c
Explanation: Debugging is the process of finding and resolving defects or problems within a computer program that prevent correct operation of computer software or a system. The process of finding and fixing bugs is called debugging and is a normal part of the development process.

3. Where is the error icon shown in the Internet Explorer?
a) Taskbar
b) Status bar
c) Both Taskbar and Status bar
d) Bookmarks bar
View Answer

Answer: b
Explanation: The error icon option can be enabled in the Tools. To view the console, select Tools –> Error Consol or Web Development.
advertisement
advertisement

4. Where is the error icon option available?
a) Tools
b) Help
c) File
d) Edit
View Answer

Answer: a
Explanation: The error icon option can be enabled in the Tools. To view the console, select Tools –> Error Consol or Web Development.

5. Which of the following is the window that the Firefox sends the error messages to?
a) Bug Window
b) Error Issues
c) Error Window
d) Error Console
View Answer

Answer: d
Explanation: The browsers like Firefox, Netscape and Mozilla send error messages to a special window called the JavaScript Console or Error Console. The Error Console is deprecated in Firefox and is now only made available if you set the devtools.errorconsole.enabled preference to true.
advertisement

6. What is the procedure to view the console in the Firefox?
a) Tools -> Error Console
b) Tools -> Error Window
c) Help -> Error Console
d) Tools -> Bug window
View Answer

Answer: a
Explanation: The error icon option can be enabled in the Tools. To view the console, select Tools –> Error Console or Web Development.

7. What is the other way of calling the Error Console in Firefox?
a) Error Window
b) JavaScript Console
c) JavaScript Window
d) Error or JavaScript Window
View Answer

Answer: b
Explanation: The browsers like Firefox, Netscape and Mozilla send error messages to a special window called the JavaScript Console or Error Console. The Error Console is also termed as the JavaScript Console.
advertisement

8. What kind of error notifications are shown in the console window?
a) Syntax error
b) Runtime error
c) Both Syntax error and Runtime error
d) Compilation error
View Answer

Answer: c
Explanation: The browsers like Firefox, Netscape and Mozilla send error messages to a special window called the JavaScript Console or Error Console. Error notifications that show up on Console or through Internet Explorer dialog boxes are the result of both syntax and runtime errors. These error notification include the line number at which the error occurred.

9. How do we debug a script?
a) Use of JavaScript Validator
b) Use of JavaScript Debugger
c) Use of JavaScript Validator & Debugger
d) Use of javascript interpreter
View Answer

Answer: c
Explanation: Both the JavaScript Validator and the JavaScript Debugger can be used to debug a script. The debugger statement stops the execution of JavaScript, and calls (if available) the debugging function.
advertisement

10. What is the purpose of a JavaScript debugger?
a) Correction of errors
b) Placing script execution under control
c) Correction of errors & Placing script execution under control
d) Compilation
View Answer

Answer: b
Explanation: A debugger is an application that places all aspects of script execution under the control of the programmer. Using the debugger statement has the same function as setting a breakpoint in the code. Debuggers provide fine-grained control over the state of the script through an interface that allows you to examine and set values as well as control the flow of execution.

Sanfoundry Global Education & Learning Series – Javascript Programming.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

advertisement
advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn | Youtube | Instagram | Facebook | Twitter