package moreorless.ian
fun unaryOperation(x:Int, op:(Int) -> Int){
}
fun outsideFunction() {
for (number in 1..30){
unaryOperation(20, { x-> println(number)
x * number
})
}
}
fun main(args: Array<String>) {
outsideFunction()
}
does not print 1
2
3
etc
only if i add println(x) after the for loop outside lambda ? why?