JSFiddle - React, Tailwind, and code Playground

JavaScript

(function() {
    var lastStorageId = 0;

    this.Object.hash = function(object) {

        return object.__id || (object.__id = '#' + lastStorageId++);
    };
}());

a = { 'a' : 1 }
b = { 'a' : 1 }

Object.hash(a) // #0
Object.hash(b) // #1
Object.hash(a) // #0