Skip to content Skip to sidebar Skip to footer
Showing posts with the label Defineproperty

Make A Property That Is Read-only To The Outside World, But My Methods Can Still Set

In JavaScript (ES5+), I'm trying to achieve the following scenario: An object (of which there … Read more Make A Property That Is Read-only To The Outside World, But My Methods Can Still Set

Using Object.defineproperty And Accessing A Variable In Private Scope

The following doesn't work, from my getter, I can't see _nickname defined in the 'class… Read more Using Object.defineproperty And Accessing A Variable In Private Scope