Posted By

nerdfiles on 12/20/09


Tagged

variables variable variablevariables javascripts


Versions (?)

Variable Variables in JS, non-window object ("globals") method


 / Published in: JavaScript
 

  1. Don't use (window) globals.
  2. Don't use eval().
  1. var $gloob = {
  2. p: 0,
  3. varvar: []
  4. }
  5.  
  6. $gloob.varvar["var"+$gloob.p] = "pppppp";
  7. alert($gloob.varvar["var0"] == "pppppp");

Report this snippet  

You need to login to post a comment.