JSFiddle - React, Tailwind, and code Playground

by f0t0n

JavaScript

(function() {
    var Store = function() {
    };
    
    Store.prototype.set = function(key, value) {
        localStorage.setItem(key, value);
        return this.get(key);
    };
    
    Store.prototype.get = function(key) {
        return localStorage.getItem(key);
    };
    
    var store = new Store();
    console.log(store.set('foo', 'bar'));
})();