Polyfill
- Some html5 feature may not suit old browsers, a polyfill allows you to use the new tech in it
- It will check if the current browser support it or not
- if not, import code to patch
- eg
if(!Number.isNaN){
Number.isNaN = function(num){ ... }
}
Shim(垫片)
- shim ⊇ \supseteq ⊇ polyfiil
- shim is a library that brings a new API to an older environment
- A polyfill is a shim for a browser API