Assigning variable by name

So I was coding a a block that would basicly act as an equivalent to +=, -=, *=, etc. in most other programming languages like so:

untitled script pic

It would work like map (()) over [=], but for variables (think a more evolved form of change [] by ())

However, In order for me to do so, I need to be able to set a variable by its name but it wasn't working. I looked up in the forum why and I found a post from bh:

I'm not necessarily asking for it to be brought back (bh does make some good points) but at the very least is there a javascript function that will allow this?

Create variables library

thank you

Another technique it's good to know is the use of RUN or CALL to give blocks inputs they wouldn't otherwise accept:

This works in lots of other situations too.

1 Like