2022/10/10 Workers Runtime Release Notes

Changes last week:

4 Likes

hey harris :wave:

  • console.log now prints more information about certain objects, for example Promises.

what does this one mean exactly? what would console.log print if I pass it a Promise?

Before, console.log(promise) would log the result of serializing promise to JSON, which is an empty JS object: {}. Now, for values that serialize to JSON as empty objects but are not themselves empty objects, console.log() falls back to serializing the value to a string, so console.log(promise) would instead log the string "[object Promise]". Hopefully, this is more informative during debugging than the previous behavior.

3 Likes

thank you - gotcha, and agree, very useful!