Basically (simplified examples to keep them short):
Code: Select all
'use strict';
let obj = {};
// Fill the object with the rest of the extension's code
console.debug(obj)
// |- Object { a: 1, b: 2, c: 3}
let key = 'a';
console.debug(obj[key])
// |- undefined
console.debug(obj.hasOwnProperty(key))
// |- false
This piece of code is executed inside an anonymous function, which exports an object that access this "private" obj variable through a number of closures.