What is a built in object in Javascript? -


this question has answer here:

i read 1 of differences between object-based , object-oriented former supports built-in objects(eg., window object in javascript).so, built-in object , why isn't there in object-oriented language java.

that's not difference between 2 terms.

for programming language considered "object-oriented", must support following 4 programming concepts:

  1. inheritance
  2. encapsulation
  3. abstraction
  4. polymorphism

there many languages support these "four pillars of oop" (java, c/c++, c#, javascript, etc.).

some languages, however, don't. famous example of call "classic vb" (visual basic prior introduction of .net). language simulate inheritance, there not actual mechanism built language it, while "classic vb" had native objects, "object-based", "not object-oriented", programming language because support concept of objects, not aspects true oop language requires.

it should noted many oop languages built on concept of "classes" mechanism generate objects from. and, while popular way architect objects, not requirement language oo. javascript not have classes (despite having class keyword), has "prototypes" , architecture upon objects implemented.

your question "native" objects not related of this. read native objects related of @ this wikipedia page, page had many errors on , have edited page more accurate. whether or not language has "built-in" or "native" objects not @ related whether object-oriented or object-based, since both types of languages object-centric (my own term). example, vb 6 object-based language, supported wide array of native objects , vb .net (its successor) object-oriented , supports vast amount of native objects.

i tell "native" object 1 built right language specification , runtime environment has access internally. in javascript, examples string, date, array, regex, math, object, etc. note while, in question, mentioned window, window not native javascript object, object supplied browser hosts javascript runtime. if running javascript in node.js, window not available because not native javascript , node doesn't provide such object runtime.

here links @ understand oop concepts , how work in javascript:


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -