Check if one JavaScript code is equivalent to another code