H
Helmut Giese
Hello out there,
I am new to JS so please bear with me.
I am tasked to investigate, whether it is feasible to port one of our
applications from Tcl to JS - the idea being to write a program to do
the conversion, mapping language constructs from Tcl to equivalent
constructs in JS.
If we pursue this project I will surely come here more often but
for a starter I have this question:
Tcl syntax:
set i 1 // equivalent to 'var i = 1;'
puts "$i" // prints '1' - $i returning the current value of 'i'
In Tcl one can create names of variables at run-time, like
set i 1
set a$i "some string"
the last statement creating a variable with the name 'a1' and the
value "some string".
Question: How do I achieve this in JS?
Any insight will be greatly appreciated.
Best regards
Helmut Giese
I am new to JS so please bear with me.
I am tasked to investigate, whether it is feasible to port one of our
applications from Tcl to JS - the idea being to write a program to do
the conversion, mapping language constructs from Tcl to equivalent
constructs in JS.
If we pursue this project I will surely come here more often but
for a starter I have this question:
Tcl syntax:
set i 1 // equivalent to 'var i = 1;'
puts "$i" // prints '1' - $i returning the current value of 'i'
In Tcl one can create names of variables at run-time, like
set i 1
set a$i "some string"
the last statement creating a variable with the name 'a1' and the
value "some string".
Question: How do I achieve this in JS?
Any insight will be greatly appreciated.
Best regards
Helmut Giese