Sometimes I looked at js with the google.com homepage and found that they usually use the syntax (0, obj.func)(args) . Here are excerpts from the script:
var _ = _ || {}; (function (_) { var window = this; try { _.mb = function (a) { return (0, window.decodeURIComponent)(a.replace(/\+/g, " ")) }; _.zg = function (a, b) { for (var c = a.length ? a.split("&") : [], d = 0; d < c.length; d++) { var e = c[d]; if ((0, _.Ag)(e) == b) return (c = /=(.*)$/.exec(e)) ? (0, _.mb)(c[1]) : null } return null }; _.Ag = function (a) { return (a = /^(.+?)(?:=|$)/.exec(a)) ? (0, _.mb)(a[1]) : null }; var Cg = function (a, b) { var c = a.indexOf("?"); return 0 > c ? null : (0, _.zg)(a.substring(c + 1), b) };
Why add 0?
javascript
lyrically wicked Oct 23 '13 at 7:36
source share