JSFiddle - React, Tailwind, and code Playground
JavaScript
var store = (function() {
var map = {};
return {
set: function ( name, value ) {
map[ name ] = value;
},
get: function ( name ) {
return map[ name ];
}
};
})();
store.set( 123, 'some value' );
console.log( store.get( 123 ) );
console.log( store.get( 456 ) );