JavaScript func_get_args
!No description available for func_get_args. @php.js developers: Please update the function summary text file.
1 2 3 4 56 7 8 9 1011 12 13 14 1516 17 18 19 2021 | function func_get_args () { // !No description available for func_get_args. @php.js developers: Please update the function summary text file. // // version: 1008.1718 // discuss at: http://phpjs.org/functions/func_get_args // + original by: Brett Zamir (http://brett-zamir.me) // % 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);} |
Examples
Running
1 2 | function tmp_a () {return func_get_args();} tmp_a('a', 'b'); |
Should return
1 | ['a', 'b'] |
Dependencies
No dependencies, you can use this function standalone.
Open syntax issues
php.js uses JsLint to help us keep our code consistent and prevent some common bugs.
Eventually we want all code to pass or at least take into consideration most fixes suggested by JsLint, following this JsLint configuration we’ve decided on.
Authors
Thanks to the following developers, you get to have func_get_args goodness in JavaScript.
No comments yet. Be the first!
spread the word:
Use any PHP function in JavaScript
These kind folks have already donated: @HalfWinter, Paulo Freitas, Andros Peña Romo, Nitin Gupta, @nikosdion, Anonymous, Anonymous and Shawn Houser.
<your name here>