when False
Executes the given block if the Boolean value is false.
This function is useful for chaining operations based on a boolean condition without breaking the flow.
Example:
val fileExists = File("path/to/file").exists()
fileExists.whenFalse {
println("File does not exist, creating it now.")
// logic to create the file
}Content copied to clipboard
Return
The original Boolean value (this).
Parameters
block
The block of code to execute. The boolean value (false) is passed as its argument.