Unable to access variable in for loop
See original GitHub issueI’m trying to create a reverse lookup table based on another variable, but it fails with a “No such variable” error.
Example JSLT that I expected to return the string “dk”:
let lookup = {
"dk" : "Denmark",
"se" : "Sweden"
}
let reverse = {for ($lookup) .value : .key}
get-key($reverse, "Denmark")
If I comment out the call to optimizeLets
on line 123 of ExpressionImpl.java it works as expected.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Cannot Access Variable inside the for loop - Stack Overflow
I'm trying to concatenate string values from clientGroupList to make a string variable. I cannot access to the returned variable.
Read more >Why can't I access the variable value after a loop - New to Julia
Hi, I use Pluto to run Julia, but I have a problem wanting to get the value of the variable x_t1 out of...
Read more >Variable Scope | Fix error: 'yourVariable' was not declared in ...
We've got a function called setup and we have a function called loop. If I create a variable inside setup I can't use...
Read more >SyntaxError: a declaration in the head of a for-of loop can't ...
The head of a for...of loop contains an initializer expression. That is, a variable is declared and assigned a value for (const i...
Read more >Unable to access variable outside loop
I am unable to access the value set inside the loop from outside loop . Thought of taking this to forum , I...
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
Sure! I’ll try to get it done during the weekend.
I may try to sneak in PR #72 and also implement issue #56.
@larsga Any chance for a release with this fix? 😃 We’re hitting this in another case now, where we don’t have a workaround currently.