Not all arrays are arrays
You modified the Array object to include some of your custom methods. You create an array, you use the method and get an error: Array.prototype.loop = function (fn) { var length = this.length; for (var i=0;i
Tips and tricks I learned throughout the years.
JavaScript looks familiar to many engineers, but behaves differently in all the places that matter. Here I share practical lessons that help whether you're just getting started or already shipping in production.
You modified the Array object to include some of your custom methods. You create an array, you use the method and get an error: Array.prototype.loop = function (fn) { var length = this.length; for (var i=0;i
There is an issue that beginners JavaScript developers frequently face. You read a few tutorials and learn about document.write(). It is equivalent to echo in PHP, or print in many languages. All it does is print a text …
If you learn a JavaScript tutorial today, chances are they told you that all the scripts are loaded in the head of the document. Then as you advance in your learning, you will see that it is religiously recommended that …
When is the right time to run your JavaScript? When the page has loaded? When the document is ready? You may face this challenge and the solution sometimes is not so simple. The Browse inconsistently offers solution to …
There was a little hack that I used to detect internet explore using JavaScript. I don't know if I should say "Too bad" it doesn't work as well anymore. Lately the Internet Explorer team has be working tirelessly to keep…
If you want to display tablular data on the browser, all you have to do is use a table. If you happen to want to display it in the terminal window (or in a pre tag), it becomes a little more difficult. Here is a little t…
Cookies There are better ways to save information on the browser then using cookies. Cookies save all values in one long string and has to be parsed every time you need to retrieve a value. The way cookies work is that t…
It's hard to see what requestAnimaionFrame() does without reading about it. The traditional way of doing animation is to generate one frame then then run setTimeout at a specific time interval to make the animation as sm…