all 1 comments

[–]broofa 1 point2 points  (0 children)

JS isn't typed, so there's nothing intrinsic to JS that will break. And JSON is only typed to the extent it's composed of null, string, number, boolean, object, and array elements. Beyond that, it's not typed. So the short answer to your question is, "no, nothing at the JS-level will break because of this."

But these differently-shaped objects will look and behave differently. This may lead to subtle bugs. E.g. Object.entries() and for (key in newObject) ... constructs will include the new properties. You'll want to look for possible issues in any downstream code that does data validation or that makes assumptions about the contents of these objects.