The OH 3.3.0 Actions Timers documentation example code uses
myTimer?.cancel()
but most DSL examples use
myTimer.cancel()
What is the correct usage and what is the difference?
The OH 3.3.0 Actions Timers documentation example code uses
myTimer?.cancel()
but most DSL examples use
myTimer.cancel()
What is the correct usage and what is the difference?
Both are correct. The myTimer?.cancel()
is a short hand way to write
if(myTimer !== null) myTimer.cancel()
@rlkoshak Thanks