I am in the middle trying to figure out at least parts of the fantastic dropzone.js. I am pretty green with a JavaScript idea and a prototype paradigm. There is a line of code right on the fourth line, which I wonder what it does, and why use such a line. The line is as follows:
var __slice = [].slice
Did I understand correctly that this takes a slice function from an array prototype object and just gives it a slightly simpler way to refer to it? What is the advantage of this approach? And why double underlining at the beginning? I read somewhere that this will prevent conflicts in the global area, but this can no longer be avoided by wrapping all the code in
(function() {
}).call(this);
to build?
source
share