3 ms·
There must not be a space between the "#1" and the "=" - it behaves as one token, "#1=". Otherwise you get an "Illegal Character" error. Playing with it in Fi
by 10ren 18y ago
There must not be a space between the "#1" and the "=" - it behaves as one token, "#1=". Otherwise you get an "Illegal Character" error.
Playing with it in Firefox's error console (is there an easier way?), it seems general. e.g. this works:
var myArray = [1, 2, #1= [1,2,#1#]]; myArray.toSource();
The sharp variables seem to work as if you generated them as incrementing labels. Hence, the references must be back-references not forward-references (so you can say "[1, #1= [2, 3], #1#]", but not "[1, #1#, #1= [2, 3]]"). And they must be numeric ("[1, #a= [2, 3], #a#]" is out). And their naming becomes the order they are needed in (so "#2= [#1= [#2#], #1#]" becomes "#1=[#2=[#1#], #2#]"). Reminiscent of regex backreferences.