Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shim vs. Sham: What is the difference?

What is the difference between a shim an a sham?

Is it enough to include es5-shim.min.js and es6-shim.min.js or should I also include es5-sham.min.js and es6-sham.min.js?

like image 460
garbanzio Avatar asked Dec 16 '14 16:12

garbanzio


1 Answers

According to this Github page the shims include all monkey-patches that faithfully represent the ES5 features.

In other words: you can use the features provided by these files as if you were using ES5 proper.

The shams, however contain those features that can not be emulated with other code. They basically provide the API, so your code doesn't crash but they don't provide the actual functionality.

Which ones do you need? That depends on how you write your code. If you only use features provided by the shims, then include that. If you also want to (optionally) use features from the shams, then you need both of them.

like image 91
Joachim Sauer Avatar answered Oct 22 '22 20:10

Joachim Sauer