https://tutorial.eyehunts.com/js/javascript-check-if-object-example-code/
JavaScript check if object | Example code