Compares two JavaScript objects and returns an array of their differences.