So I've been reading up on lambdas in VB recently and am a bit confused tbh. I've got the code running properly, but want a better understanding. My main question is the use of the Invoke() method and the way of declaring a lambda.
One method I've seen is this:
Dim increment2 = Function(x)
Return x + 2
End Function
and the other:
Dim func1 As Func(Of Integer, Integer) =
Function(value As Integer)
Return value + 1
End Function
My question is, what's the difference? And what role does the Invoke() method play. I've seen to ways of calling lambdas, one like func1(4) and the other is func1.Invoke(4).
I should mention, that regardless of what change I make the output remains the same (5), leading me believe the change is something not very noticeable. And I'm curious as to what it is.