JSFiddle - React, Tailwind, and code Playground

JavaScript

var object1 = new Object();
var object2 = object1;

object1.someVariable = 'asdf';
object2.someVariable = 'newValue';
console.log(object1.someVariable); // will give 'newValue'
console.log(object2.someVariable); // will also give 'newValue'

var primitiveString = 'asdf';
var anotherPrimitiveString = primitiveString;

anotherPrimitiveString = 'newValue';
console.log(primitiveString); // will give 'asdf'
console.log(anotherPrimitiveString); // will give 'newValue'