@iam4x yep, it's slower than your solution, but when you haven't time to implement some new stuff like this you can just filter array :)
Or you can try something like this
[1, 2, 3, 4, 1].filter(function(item, index, all){
return all.lastIndexOf(item) === index;
});
Prevent this behavior using:
Prevent what? Hey, guys, are you fucking kidding me? RTFM. The second argument for parseInt is numeral system. When you ignore this argument, parseInt try to choose the most proper numeral system. So, when you call parseInt("023") (without second argument) you will get parsed integer in octal numeral system
parseInt("023", 8); // 19
parseInt("023", 10); // 23
var isOdd = function (n) { return !!(n % 2); };
I think it's easier :)
expression
'ontouchstart' in window
will return boolean value and it's not required to create boolean manualy (using!!
)expression window.hasOwnProperty('ontouchstart') is faster :)
var isMyObjectEmpty = !Object.keys(myObject).length;
In Windows it's Alt+.
JavaScript doesn't have classes ;)
I prefer Sublime Text 2 + Live Reload
https://github.com/dz0ny/LiveReload-sublimetext2
Brackets is good, but it hasn't a lot of features like in Sublime
@viczam using _.wrap you will do the same as @anasnakawa wrote