ES6 and JavaScript: Constructors

JavaScript is not an object oriented language (OOP), but an object-based language. That is to say, everything which exists in JS is an object: classes, numbers, functions…are all {}.

By comparison, C++ an OOP language, to create an object, one must first instantiate a class and then implement a constructor which then creates an object.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
MDN

MDN

Composer, Designer, Educator