arguments test

Demonstrate that the arguments object does not contain all arguments in Chrome unless it is referenced in the function

JavaScript

function someArguments(arg1, arg2){
    debugger;
    //inspect arguments here
    return;    
}

function allArguments(arg1, arg2){
    //because arguments is read, it is populated completely
    arguments;
    debugger;
    //inspect arguments here
    return;
}
    
someArguments('test1', 'test2', 'test3', 'test4');

allArguments('test1', 'test2', 'test3', 'test4');