JSFiddle - React, Tailwind, and code Playground

by Neal

JavaScript

var storage = (function() {
    var store = [];
    return {
        "add": function(item) {
            store.push(item);
        },
        "get": function() {
            return store;
        }
    };
}());

storage.add('hi there')
console.log(storage, storage.get(), (function() {
    storage.add('hi there #2');
    console.log('TESTING');
})());