Tag Archives: mobile service

JavaScript: Using Closure Space to Create Real Private Members


via JavaScript: Using Closure Space to Create Real Private Members | NOUPE.

I recently developed Angular Cloud Data Connector, which enables Angular developers to use cloud data, specifically Azure mobile service, using web standards like indexed DB. I was trying to create a way for JavaScript developers to embed private members into an object. My technique for this specific case is to use what I call “closure space”. In this tutorial, I want to share with you how to use this for your own projects and how performance and memory are impacted for the major browsers.
But before diving into it, let me share why you may need private members, as well as an alternate way to “simulate” private members.