You cannot create a stand-alone variable name that way (except as a global) (edit or except with eval()
), but you can create an object property:
var tab_counter = 1;
var someObject = {};
someObject['editor' + tab_counter] = "bla bla";
You can create globals as "window" properties like that, but you probably shouldn't because global variables make kittens cry.
(Now, if you're really just indexing by an increasing counter, you might consider just using an array.)
edit also see @Birey's somewhat disturbing but completely correct observation that you can use "eval()" to do what you want.