Javascript func_get_args : Function Handling : PHP functions in JavaScript JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » PHP functions in JavaScript » Function Handling »

 

Javascript func_get_args


Example 1

Running
1.function tmp_a() {return func_get_args();}
2.tmp_a('a', 'b');

Could return
1.['a', 'b']
function func_get_args() {
    // !No description available for func_get_args. @php.js developers: Please update the function summary text file.
    // 
    // version: 812.1714
    // discuss at: http://phpjs.org/functions/func_get_args
    // +   original by: Brett Zamir
    // %        note 1: May not work in all JS implementations
    // *     example 1: function tmp_a() {return func_get_args();}
    // *     example 1: tmp_a('a', 'b');
    // *     returns 1: ['a', 'b']
    if (!arguments.callee.caller) {
        try {
            throw new Error('Either you are using this in a browser which does not support the "caller" property or you are calling this from a global context');
            return false;
        } catch(e){
            return false;
        }
    }

    return Array.prototype.slice.call(arguments.callee.caller.arguments);
}


HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo PHP functions in JavaScript
» Function Handling