How to decouple methods from classes in JavaScript

Dr. Derek Austin 🥳
1 min readSep 19, 2019
Photo by David Rotimi on Unsplash

Very cool, thanks for sharing about how Object.assign() can be useful when working with objects in JavaScript Aphinya!!!

I thought the following example was very clear:

Keep up the great work writing about JavaScript Aphinya Dechalert!!!

Thanks to Christopher Jeffery for pointing out that Object.assign does not use prototypal inheritance; it instead applies the property/method directly to the instance of the object.

--

--

Dr. Derek Austin 🥳
Dr. Derek Austin 🥳

Written by Dr. Derek Austin 🥳

Hi, I'm Doctor Derek! I've been a professional web developer since 2005, and I love writing about programming with JavaScript, TypeScript, React, Next.js & Git.

Responses (1)