Skip to content

Instantly share code, notes, and snippets.

@mediamichael
Created September 17, 2013 22:27
Show Gist options
  • Save mediamichael/6601545 to your computer and use it in GitHub Desktop.
Save mediamichael/6601545 to your computer and use it in GitHub Desktop.
Create an object from a dynamic variable name and assign a global class.
var rnd = Math.floor(Math.random()*10000000000);
var myVar = "myString" + "_" + rnd;
window[ myVar + "_optionalID"] = new classname();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment