Variable Re-assignment
See original GitHub issueIf I declare a variable and assign an initial value, can I re-assign a different value to it afterwards?
The code below isn’t working:
let var = "test"
$var = "test2"
{
"variable": $var
}
Error: com.schibsted.spt.data.jslt.JsltException: Parse error: Encountered " "=" "= "" at line 2, column 6.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8
Top Results From Across the Web
5.1 Variable Reassignment and Object Mutation
A variable reassignment is a Python action that assigns a value to a variable that already refers to a value. The most common...
Read more >2.10. Reassignment — How to Think like a Computer Scientist
A new assignment makes an existing variable refer to a new value (and stop referring to the old value). Save & Run. Original...
Read more >NCL Variable Assignment / Reassignment
To reassign a variable to something with a different shape or a higher type, you must either use the delete procedure, or the...
Read more >Introduction to Python Variables and Assignment - AlgoDaily
Values can be reassigned to variables in Python. When variables are reassigned, their value changes to that of the newer value specified, and...
Read more >Reassignment vs Mutability - DEV Community
Reassignment consists of assigning a new value for a variable using the = operator. This restriction on the part of const also leads...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, JSLT is a functional language. That gives implementations much more freedom, and makes it easier to implement optimizations.
If these loops end up being a performance problem please come back, and we can look at how to deal with that.
I don’t think it will become an issue, but thank you, I will keep that in mind, and try to adapt to functionnal logic. Thank you 😃