Posted By

uberdragon on 03/31/11


Tagged


Versions (?)

PHP's func_get_args() for Javascript


 / Published in: JavaScript
 

  1. function func_get_args () {
  2. if (!arguments.callee.caller) {
  3. try {
  4. 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');
  5. // return false;
  6. } catch (e) {
  7. return false;
  8. }
  9. }
  10.  
  11. return Array.prototype.slice.call(arguments.callee.caller.arguments);
  12. }

Report this snippet  

You need to login to post a comment.