Skip to content

Commit 0fd53fa

Browse files
committed
docs: Document using 'return' string in expressions (#3625)
1 parent 15a0c34 commit 0fd53fa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/Scripting/Expressions.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ As of Tasks 4.4.0, it is also possible to use more complex constructs in express
8686
- `if` statements
8787
- functions
8888

89+
Note in the examples below that if `return` appears anywhere in the expression, you must write your own `return` statement, to prevent the result being `undefined`.
90+
8991
As of Tasks 5.0.0, it is also possible to make longer expressions more readable using [[Line Continuations|line continuations]].
9092

9193
<!-- placeholder to force blank line before included text --><!-- include: Expression.test.Expression_returns_and_functions.approved.md -->
@@ -97,6 +99,12 @@ return 42
9799
const x = 1 + 1; return x * x
98100
=> 4
99101
102+
'any text that contains the word return'
103+
=> undefined
104+
105+
return 'any text that contains the word return'
106+
=> 'any text that contains the word return'
107+
100108
if (1 === 1) { return "yes"; } else { return "no" }
101109
=> 'yes'
102110

0 commit comments

Comments
 (0)