JavaScript Crib Sheet

Parameters:

  • Get Parameters from Query *:
    function getURLParameter(name) {
        return decodeURI(
            (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
        );
    }
  • Array Methods *:
    • Add to the beginning: array.unshift(val);
    • Add to the end: array.push(val);

 

Leave a Reply

Your email address will not be published. Required fields are marked *