Assertion

Report a typo

How does this assertion work in the following example:

fun sqrt(x: Double): Double {
    require(x >= 0) { "Invalid argument" }
    return Math.sqrt(x)
}
Select one option from the list
___

Create a free account to access the full topic