Posts

Showing posts with the label Javascript

JavaScript Multiple Choice Questions

1. What is JavaScript? a) JavaScript is a scripting language used to make the website interactive b) JavaScript is an assembly language used to make the website interactive c) JavaScript is a compiled language used to make the website interactive d) None of the mentioned View Answer Answer: a Explanation: JavaScript is a scripting language used along with HTML and CSS to make the website interactive along. It is used both on the client-side and server-side. 2. Which of the following is correct about JavaScript? a) JavaScript is an Object-Based language b) JavaScript is Assembly-language c) JavaScript is an Object-Oriented language d) JavaScript is a High-level language View Answer Answer: a Explanation: Although JavaScript is not an OOP (Object-Oriented Programming) language like Java or PHP, it is an object-oriented language. The standard threesome of polymorphism, encapsulation, and inheritance are the criteria for object orientation, and JavaScript fails to meet them. 3...

JavaScript Multiple Choice Questions

Image
JavaScript MCQ I. This set of questions focuses on the statements in JavaScript 1) Which type of JavaScript language is ___ Object-Oriented Object-Based Assembly-language High-level Hide Answer Workspace Answer: B Explanation: JavaScript is not a pure OOP's (object oriented programming) based languages such as PHP, java or many other languages, although it is an object-based language. It is not OOP's based language, because it doesn't have three basic properties of object-oriented programming languages, such as polymorphism, encapsulation, and inheritance. 2) Which of the following is the correct output for the following JavaScript code: varx=5,y=1 var obj ={ x:10} with(obj) { alert(y) } varx=5,y=1 var obj ={ x:10} with(obj) { alert(y) } 1 Error 10 5 Hide Answer Workspace Answer: A Explanation: The output of the above snippet code will be one because, first of all, the interpreter will search "obj" for the property (y). But it fails to find "obj...