Joined December 2012
·

Alexandr Subbotin

Cloud Castle
·
Russia, Samara
·
·

Another approach is to use bind method of functions:

window.setTimeout(callback.bind(null, 'foo', 'bar'), 1000);

And it is working in IE since 9 version and you can grab polyfill at MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind

Posted to JavaScript: Is the variable defined? over 1 year ago

In most cases undefined is not declared variable. If you want to declare empty variable, initialize it with null, not undefined and then just test for condition typeof x == 'undefined'

It is bad practice when you have, for example, master and production branches, If you put your fixes to production branch and then merge it into master, then your script will delete production branch

Posted to Sublime Text 2 - quick full screen over 1 year ago

You have a typo in "usesimplefullscreen", should be "usesimplefullscreen"

Posted to Why never use new Array in Javascript over 1 year ago

@dvdotsenko you can use it without creating "a" object and call "new" by var newstring = Array(times + 1).join(oldstring)

Achievements
402 Karma
33,181 Total ProTip Views