JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://rawgithub.com/melanke/Watch.JS/master/src/watch.js"></script>

JavaScript

//defining our object no matter which way we want
var ex6 = {
    attr1: 0,
    attr2: 1
};

//defining a 'watcher' for the object
watch(ex6, function(){
    alert("some attribute of ex6 changes!")
});

ex6.attr3 = null; //no watcher will be invoked
ex6.attr3 = "value"; //no watcher will be invoked