Posts Tagged ‘jQuery’

“Appearances can be deceiving Mr. Anderson” – a.k.a. short code is not always fast code

Wednesday, February 25th, 2009

I used to take pride in my short, bulletproof and elegant String and Number type checks:

// Check whether obj is a Number
obj + 0 === obj

// Check whether obj is a String
obj + '' === obj

I always thought that apart from being short and elegant, they should be faster.

However, some quick tests gave me a cold slap in the face and proved my assertion to be entirely false. (more…)

JS library detector

Wednesday, February 11th, 2009

Ever wondered which JavaScript library (if any) is hidden beneath the bells & whistles of each site you gazed at? Since I am a curious person, I find myself wondering every time, so after a bit of research, I wrapped up a little bookmarklet that instantly told me the answer every time. (more…)