Adding properties to the start of an object in javascript

Javascript has the build in unshift() method for pushing items to the beginning of an array. However unfortunately there is not an equivalent method for objects. One solution is to use arrays instead of objects when possible. However this might not always be possible. There are many times when you get a JSON as a response from an AJAX request and you need to display something before the returned items because of a user action. Read more

How to declare global variables in JavaScript

You may have heard or read that global variables are a bad idea. However sometimes you may need a global variable badly. To use them properly it’s best to understand the concept of scope in JavaScript. Let’s take the following example to understand the local and global scope: Read more

Follow us for more great posts in the future.

Facebook Twitter

Get posts in your email