How do I do an "early return"? #657
Unanswered
mrtry
asked this question in
Help needed
Replies: 2 comments
-
You can wrap the entire code into IIFE, so |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wanted to check the flag and return the shell script early.
I tried two patterns, but they did not seem to work.
In the following case,
exit 0
was evaluated, but code execution did not stop and subsequent code blocks were also evaluated.The following will result in an error
SyntaxError: Illegal return statement
.This also results in a syntax error.
The version of zx is "7.2.3".
What should I do?
Beta Was this translation helpful? Give feedback.
All reactions