use map to dynamic names variable code example Example: js changing name variable window[someVaribale]="foo"; window["name_" + someVariable]="foo";