Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing value not a reference
Message
De
21/03/2016 10:05:12
 
 
À
21/03/2016 05:50:38
Information générale
Forum:
Javascript
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01633405
Message ID:
01633419
Vues:
41
>Integers are passed by value (I'm assuming lnLeft/lnTop *are* integers) so something else must be going on.
>e.g:
                 var i = 5;
>                  oDiv.onmouseout = function(e) {
>                      OnMouseOut(e, i);
>                      alert("After"+i); // 5
>                  };
>                  
> 
>                  function OnMouseOut(e, i) {
>                      i = i + 1;
>                  }
Yes, I would adjust to use the var declaration approach instead.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform