Ad
  • Custom User Avatar

    Did you read eloquent javascript? The main thing that I think would be confusing is scope and closures, so perhaps looking into those two topics would be helpful.

    function mainScope (args) { //main function
    var newfunction = function(){ //still has access to variables accessible in mainScope
    return args; //can manipulate args as expected
    };
    return args;
    }

    function secondaryScope (args) { //new function
    newFunction(); //would throw error
    }