const isEqual = (...objects) =>
objects.every((obj) => JSON.stringify(obj) === JSON.stringify(objects[0]));
if (!isEqual(this.lastValue, val)) {
//turn them into text then compare their values
JSON.stringify(obj1) === JSON.stringify(obj2)
/*not the best solution but work for simple objects without methods
Happy Coding */ (●'◡'●)