3 ms·
https://stackoverflow.com/a/13864829 https://stackoverflow.com/a/13864829 It is not nonsense. You use that expression if you want to check if a variable exists
by imtringued 2y ago
https://stackoverflow.com/a/13864829 https://stackoverflow.com/a/13864829
It is not nonsense. You use that expression if you want to check if a variable exists or not (as opposed to being set to an empty string) which is an extremely common problem.
- dezgeg 2y agoThe +x needs to belong inside the {}, ie. "${var+x}" not "${var}+x" But I agree I wouldn't extrapolate too much from one such brain fart
- delusional 2y agoThat what I meant by "I can see what they were trying to do". It's would have been correct if the "+x" was inside the braces, even in context. He did in fact want to check if the variable was unset and error out, and that's what hurts so much. There was a real and correct analysis that, hey, I want to make sure the variable is set here. Only to then drop it because you get told the syntax is wrong. The response I'm looking for when I say "This syntax won't do what you're looking to do" would be something like "what am I trying to do? and why wont this do it?" not "well it's just some AI code, I'll just remove it".
- deleted 2y ago[deleted]