Thank you reading the blog Vimal Raj

If I get this right, this should be no different. You can create functions like

const hello = new UserOffer(() => ‘this is hello’);
const hi= new UserOffer(() => ‘this is hi’)

Now when we are assigning the value of a , we can say User.setA('hello')

Does that help?

Senior Staff Engineer @freshworks. Ex-McKinsey/Microsoft/Slideshare/SAP, Tech Enthusiast, Passionate about India. Opinions are mine

Love podcasts or audiobooks? Learn on the go with our new app.

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
Abhinav Dhasmana

Senior Staff Engineer @freshworks. Ex-McKinsey/Microsoft/Slideshare/SAP, Tech Enthusiast, Passionate about India. Opinions are mine