How to Compare Objects with same format

  The object must be same with key and their length.

const compareObj = (body, ccObject) => {

            try {

                if (JSON.stringify(body) === JSON.stringify(ccObject))

                    return true;

                else

                    return false;

            }

            catch (e) {

                log.error(“error@compareObj”, e);

                return true;

            }

        }

Leave a comment

Your email address will not be published. Required fields are marked *