menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Let’s talk...
source image

Medium

1M

read

72

img
dot

Image Credit: Medium

Let’s talk javascript : Part 2 (Objects and prototypes)

  • Objects in JavaScript are collections of properties and can be created using object literal, constructor, Object.create(), and class keyword.
  • Object properties have a property descriptor that defines its attributes such as writable, enumerable and configurable.
  • Getter and Setter allow us to define custom behavior for accessing and setting property values.
  • A prototype is an object that exists in every function in JavaScript, and objects have a __proto__ property assigned to them.
  • Inheritance works in JavaScript by having the object __proto__ link to the prototype of the constructor function that created it.
  • We can add properties to a function's prototype, which will then be inherited by objects created using that function as a constructor.
  • prototype shadowing occurs when an object looks for a property in its own properties first and then in its prototype.
  • We can change the prototype object of a function to point to an entirely new object.
  • Object.create() sets up a prototype chain without invoking a constructor function, while using new would call the constructor function.
  • Next, the article covers design patterns in JavaScript in an intermediate-level topic.

Read Full Article

like

4 Likes

For uninterrupted reading, download the app