Declare an extension function

Report a typo

We have the following functions:

fun Int.negative() = -this
fun Int.addFive() = this + 5
fun Int.double() = this * 2

What is the result of the following code?

1.negative().addFive().double()
Enter a number
___

Create a free account to access the full topic