# Javascript.info 2.12 Nullish coalescing operator '??' (9/16)
ref: https://javascript.info/nullish-coalescing-operator
-----
polyfills 自動補完函式庫
A polyfill, or polyfiller, is a piece of code (or plugin) that provides the technology that you, the developer, expect the browser to provide natively. Flattening the API landscape if you will.
* 要注意瀏覽器支援度
-----
### Nullish coalescing operator ??
空值合併
1. provides a short syntax for selecting a first “defined” variable from the list.
括弧裡面的東西是最優先執行的
2. Due to safety reasons, it’s forbidden to use ?? together with && and || operators.
??比較少用
通常是去比較 null 和 defined
常用在判斷0的時候

###### tags: `Javascript`
{%hackmd BJrTq20hE %}