Use JS hack-reference to improve speed

Use JS hack-reference to improve speed

Hello!

I found on "wtfjs.com" a method to do JS-reference, as the & in php.
MAYBE this can improve JS.

This is the basic idea:

  1. function x(object){
  2.   // I need re-use object on another method
  3.   reUse(object); // I suppose that JS copy object to reUse function
  4.   console.log(object);
  5.   // Here is different, JS will pass a reference of object, but it's strange...
  6.   reUseAgain(arguments);
  7.   console.log(object);
  8. }
  9.  
  10. function reUse(object){
  11.   object = 1;
  12. }
  13.  
  14. function reUseAgain(object){
  15.   object[0] = 1;
  16. }
  17.  
  18. x(0);
  19. // log: 0 (without reference)
  20. // log: 1 (with reference)
Or be, jQuery probably (I don't know) copy too many times objects. With arguments method this can be changed. But it will really improve speed?

I cannot do this test with certain, if an expert can do, then show to us! :)

Bye.