Front end developer from Greece with professional experience in large e-commerce, administration and betting applications. Interests include: ECMAScript, Typescript, React, SEO.
This is indeed a nice trick, but do keep in mind that in order for this to work the object must not contain dates, functions, undefined, infinity, nan, regexes, maps, sets, blobs, file lists, image data, sparce / typed arrays or any other complex types. For the majority of the cases though it will do the trick.
This is indeed a nice trick, but do keep in mind that in order for this to work the object must not contain dates, functions, undefined, infinity, nan, regexes, maps, sets, blobs, file lists, image data, sparce / typed arrays or any other complex types. For the majority of the cases though it will do the trick.
If there had been any of the above mentioned, then I would not have recommended my approach.
As you stated this works in the majority of situations and for the examples given.