That's true. According to jsPerf it's 90% slower which is significant.
Good comment.
You should do a better job of explaining why that happens and why setting the radix to 10 solves that problem.
Also, mention hexadecimal numbers (which start with 0x
).
And window['prop'] even faster, but those two yield false.
The double negation is for clarity that it's a boolean.
Thanks for the comment.
@hauleth It's because of browser quirks. Not all hide the text, some show it at the default size, others at a very-small-but-still-visible size.
Plus there is/was a SEO score hit when you use(d) this.
@ipetepete Yeah, that's what I thought. They refined this a lot over time. It looks nothing like it did at the start of the year.
Thanks as well.
I'd say the HTML5Boilerplate version is better and supposedly thoroughly tested (large community).
.ir {
background-color: transparent;
border: 0;
overflow: hidden;
/* IE 6/7 fallback */
*text-indent: -9999px;
}
.ir:before {
content: "";
display: block;
width: 0;
height: 100%;
}
From: https://github.com/h5bp/html5-boilerplate/blob/master/css/main.css#L120-133
Awesome.
This should be a blog post or article.
Awesome.
I'd say this is a rather micro-optimization.
http://jsperf.com/jquery-this-caching
Awesome!
I wouldn't recommend this.
Firstly, you need to load a 3rd party script to get the _.each()
method.</p>
Secondly, that's not the proper way to extend native objects. It's not future proof. You should check for existence of each
and if not found use Object.defineProperty
to define a new property,</p>
Thirdly, there is no mention of the native forEach
method. Underscore actually delegates to that if it exists.</p>
Hm, it actually depends a lot on the browser. Bind is much faster (~80%) on IE and Opera, latest versions of both. But slower on Chrome and Firefox, also latest versions.