🏠 back to Observable

It's more of a comment than a question...


#1

:grin:

Observable is so cutting-edge that I thought that I could use the spread syntax on objects (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax#Syntax) and that it would work on all browsers. But no, there is no automatic transpiling, you have to take care of retrocompatibility when writing notebooks…


#2

Yes that is right. Please don’t use such syntax anywhere that you want to be accessible cross-platform. I browse Observable notebooks in Safari, and it can be frustrating that many of them only work in Chrome.

Presumably if you really need you could do the transpiling yourself in your notebook, e.g. by putting your code in a template literal.

The workaround for spread syntax in object literals is (under most circumstances) pretty simple. Just use Object.assign.