Skip navigation

Article published in TechAspect’s digital cum print edition of internal company official magazine TechTunes October 2015 issue (Vol 1, 2015)

Rapid and ever-growing browser technologies are a boon to internet users. At the same time, these cutting edge innovations present the developer community with a new set of opportunities and challenges. The autonomous nature of the internet produces conflicting opinions in many areas, such as standards bodies, un-finalized specs, browser differences, and so on; growth of mobile device use further adds fuel to the fire.


The ‘party’ is no longer server side but rather now inside the browser, which is controlled by the user. In other words, the browser is the new OS. Frontend developers often find themselves in unexplored territory. The shelf life of frontend technology has shortened considerably in recent years, calling for
developers to realign our strategies.

Impact on Project Success

Our success rate increases if we identify frontend risks well in advance. It is very easy to miss a CSS incompatibility, which results in a broken home page layout. The contents and underlying DOM are so dynamic they may be overlooked.


To avoid costly mistakes, it is important to understand frontend volatility, and to perform due diligence, even though it is challenging. It is also essential to understand clients’ requirements, select the right
technologies, accurately estimate UI costs, and select the right resources.

It is common in forms, to get user inputs for numerical calculations later like house rent allowance for salary calculation. In such scenarios, the value returned is string which if we add result in concatenation. To avoid this mistake adding toInt method to string object directly will be handy.

 * adding toInt method to String object
 * author rajakvk <rajakvk at gmail dot com>
if(!String.toInt) {
   * Returns integer value if a string value is passed.
   * @name toInt
   * @methodOf String
   * @param {*} none 
   * @returns {Number}
  String.prototype.toInt = function() {
     return parseInt(this, 10);
// Usage
// $('#hra').val().toInt();
// typeof $('#hra').val();  // string
// typeof $('#hra').val().toInt();  // number

Note: This method converts string to Integer discarding decimal places.

typeof method in JavaScript returns wrong value if you pass an array as parameter. To fix this, we can add isArray method to JavaScript’s native Array object. In future, if browser includes one such method, the below code will not break as it will use browser’s native code in that case.

This will be handy fix for typeof known bug for Arrays.

 * @author rajakvk <rajakvk(at)>
if (!Array.isArray) {
     * Returns true if an object is an array, false if it is not.
     * @name isArray
     * @methodOf Array
     * @param {*} value 
     * @returns {Boolean}
    Array.isArray  = function (value) {
        return === '[object Array]';



Get every new post delivered to your Inbox.

Join 226 other followers