• Quick Validating JavaScript Function Before Call

    Quick Validating JavaScript Function Before Call

    There are many instances where we have to execute a function where we have no idea whether it actually exists or not. Let’s say for example, a function expects another function passed to it as parameter, which would later be executed as callback. A very common usage would be the callback function sent to AJAX…

  • Setting Default Variable Value in JavaScript

    Setting Default Variable Value in JavaScript

    Often, there are conditions where we need to provide a default value of a variable if it is undefined. As a case study, we will take up the situation, where we are passing a Boolean value to function and if the input is true, some action has to be taken. In case someone does not…

  • String Reversing Algorithm Performance In JavaScript

    Wherever performance is the key factor, choosing the right algorithm, (in a very unbiased fashion,) is a very crucial factor. And generally for reversing string in JavaScript applications, I endorse this petite string reversal algorithm using Array.reverse() method.