0

Recently I attended an interview where I was following question on javaScript

Q: is it object based or object oriented programming Me :Object based , as there is no class and the first thing we create is an object to create other objects from it.

Q : Is it a scripting language or programming language? Me: programming language(Q: Then why there is script in the name Me: Not sure)

Q: What object oriented features are there in it? Me : Encapsulation and Inheritance (Q: Not polymorphism ? Me : No Q : but everything in javascript is late binding so why do you say it is not polymorphism is not there ME: Blank)

I had got theses answers from different tutorials online but but looks like he wasn't convinced with my answers . I did google them before posting a question over here, but still am confused as some sites say as my answers and some opposite to mine.

Could someone please help me clear my doubts ?

4
  • en.wikipedia.org/wiki/JavaScript Someone trying to put JavaScript in a cookie cutter. Does not understand JavaScript. Short answer: It does a lot and can not be fit into a cookie cutter like other languages
    – Darkrum
    Sep 8, 2016 at 17:44
  • I had seen that but one doubt is isn't interpreted programming language is scripting language only ?
    – titlu
    Sep 8, 2016 at 17:50
  • 1
    These interview questions seem pretty silly to me. They belong on a college CS quiz (in that they're not applicable to actual programming).
    – SimpleJ
    Sep 8, 2016 at 17:52
  • @SimpleJ HA! Nice jab at CS.
    – Darkrum
    Sep 8, 2016 at 17:55

2 Answers 2

0

JavaScript is a object oriented Scripting language. It has the characteristics of all object oriented principles. (Abstractions, Encapsulations, Inheritance, Polymorphic (its dynamic typing is equal to polymorphism - late binding) etc), it uses prototypical inheritance instead of conventional inheritance.

JavaScript in general is called as scripting language. Any Language that runs in an environment is a scripting language. The scripting facilitates to access various entities or objects in that environment. (in case of browser, the browser itself is an environment, in case of back end, the node is an environment).

2
  • But wikipedia say it is programming language and that is what is confusing me different source have different answers
    – titlu
    Sep 8, 2016 at 18:03
  • It evolved and now it almost has all characteristics that a programming language supposed to have. And now a days, it is used like a programming language. It is better to refer the ES spec instead of Wikipedia to understand JS more. ecma-international.org/ecma-262/6.0
    – Karpak
    Sep 8, 2016 at 18:09
0

JavaScript is a programming language AND a scripting language. These are not opposites. Scripting language is typically intepreted and the opposite is compiled language, which JavaScript isn't. Even if a scripting language has got a JIT compiler, it is still a scripting language.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.