webxdc / hello

Sample project with a simple implementation of the webxdc read and write APIs
The Unlicense
29 stars 7 forks source link

set default value for serial parameter in setUpdateListener #24

Closed adbenitez closed 2 years ago

Simon-Laux commented 2 years ago

you can do serial = 0 in the function signature and also do that in the ts to mark the argument as optional

adbenitez commented 2 years ago

will that be compatible with most browsers?

Simon-Laux commented 2 years ago

not in internet explorer (which is nearly dead anyway), but the other browsers support it for some time already: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters#browser_compatibility

adbenitez commented 2 years ago

done, pls, merge if you think it is fine