JSFiddle - React, Tailwind, and code Playground

by jfriend00

CSS

body {font-family: "Courier New"; font-size: 13px;}

JavaScript

var lol = {
    section: {},
    other: {foo: 'bar', foob: 'baz'}
};

var str = "";

// assign section.other = .other (will be a reference)
lol.section.other = lol.other;

str += "lol.other.foo is '" + lol.other.foo + "'<br>";
str += "lol.section.other.foo is '" + lol.section.other.foo + "'<br>";

// change other.foo
lol.other.foo = 'test';
str += "<hr>set: lol.other.foo = 'test'<br>";
// see what the value is of section.other.foo

str += "lol.other.foo is '" + lol.other.foo + "'<br>";
str += "lol.section.other.foo is '" + lol.section.other.foo + "'<br>";


document.body.innerHTML = str;