Updated app js file with the new method called isUndefined that checks if an object is undefined or not.