Dynamic Named Variables

[Total: 0    Average: 0/5]

This shows how to create variables on the fly that have a portion of themselvs that is derived from another variable.

Body Code:

<script type=text/javascript>
var _a = '1';
var _b = '2';
var _c = '3';
eval('_d'+_a+'='+_b+_c+_b*_c);
document.write('_d1='+_d1);
</script>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *