Condition
The writing of a condition is the following
@Event('start')
start() {
> How old are you ?
Prompt()
if (:text > 18) {
> You are major
}
else if (:text < 18) {
> You are a minor
}
else {
> You are 18 years old
}
}
Keywords
To verify that a value is either undefined
or null
, use the keyword unknown
foo(options) {
if (unknown options) {
> options are empties
}
}
Otherwise, to verify that a value is different from undefined
or null
, let's use the keyword defined
foo(options) {
if (defined options) {
> thanks
}
}
Note that these keywords must be at the beginning of the condition, we can not do
true && defined options
Last updated
Was this helpful?