Joined December 2012
·
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'
Posted to
Remove remote braches that are merged into master
over 1 year
ago
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
Mongoose 3
Have at least three original repos where Ruby is the dominant language
Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos
Forked
Have a project valued enough to be forked by someone else
Mongoose
Have at least one original repo where Ruby is the dominant language
Nephila Komaci
Have at least one original repos where PHP is the dominant language
Charity
Fork and commit to someone's open source project in need
Python
Would you expect anything less? Have at least one original repo where Python is the dominant language
Another approach is to use
bind
method of functions: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