3: Functions
Question 1
The contains(element: String)
function returns true
if the string element
is contained in the string it's called on. What will be the output of the following code?
Question 2
In the following function definition, which one of the parameters is required?
Question 3
You can pass a regular named function (not the result of calling it) to another function. How would you pass increaseDirty( start: Int ) = start + 1
to updateDirty(dirty: Int, operation: (Int) -> Int)
?
Last updated