how many instances of e are there in:
q: passing function argument in $.getscript() giving sp.requestexecutor is not a constructor console error here is my code 
use strict;
var hostweburl;
var appweburl;
// get the urls for the app web the host web url from the query string.   
$(document).ready(function () {
    //get the uri decoded urls.  
    hostweburl = decodeuricomponent(getquerystringparameter(sphosturl));
    appweburl = decodeuricomponent(getquerystringparameter(spappweburl));        

    $.getscript(hostweburl + /_layouts/15/sp.requestexecutor.js, getsubsite(/test 2));
});
//retrieve all of the folders from root site  
function getsubsite(siteurl) {
    var executor;    
    // initialize the requestexecutor with the app web url.  
    executor = new sp.requestexecutor(appweburl);
    executor.executeasync({
        url: appweburl + /_api/sp.appcontextsite(@target)/web/webinfos?$filter=webtemplate ne app&@target= + hostweburl + siteurl+,
        method: get,
        headers: {
            accept: application/json; odata=verbose
        },
        success: folderssuccesshandler,
        error: folderserrorhandler
    });
}

in above code when i dont pass argument in getsubsite like
$.getscript(hostweburl + /_layouts/15/sp.requestexecutor.js, getsubsite());

then code will work fine. so my question is how to pass argument in function and i want to call multiple async rest calls hierarchically so what is best approach for that. 

a: try writing this
 $.getscript(hostweburl + /_layouts/15/sp.requestexecutor.js, getsubsite(/test 2));

like this instead
 $.getscript(hostweburl + /_layouts/15/sp.requestexecutor.js, function(){ getsubsite(/test 2); });

to avoid immediate execution of the getsubsite method ( = to wait until sp.requestexecutor.js is actually loaded)

a: add reference at your aspx or html page
<script type=text/javascript src=/_layouts/15/sp.requestexecutor.js></script>


user
The passage contains one hundred and eighty-three "e"s.
assistant