JSFiddle - React, Tailwind, and code Playground

by Drath

JavaScript

var thingy = {
    thing1: {foo: 99, bar: 99},                    
    thing2: {foo: 99, bar: 99}
}

function scopechange() {
    thingy["thing1"].foo = 1;
    thingy["thing1"].bar = 1;
    thingy["thing2"].foo = 1;
    thingy["thing2"].bar = 1;
    localStorage.setItem('thingy', JSON.stringify(thingy));  
    var getthingy = localStorage.getItem('thingy')
    console.log(JSON.parse(getthingy));
}

scopechange();
console.log(thingy);