I came across the below placeholder syntax in scala. And could not able to under what '_' is doing in the code
def evenDef(n: Int): Int => Boolean = _ => n % 2 == 0
//evenDef: (n: Int)Int => Boolean
val result = evenDef(2)
//res: Int => Boolean = $$Lambda$5397/911325@3aa9352
result(9)
//res18: Boolean = true
I am little confused how the above is returning 'true' for the value 9, even though its a odd number.
Can anyone help me in understand the '_' in the code ?