In jQuery lambda functions, the user asks about debugging lambda expressions in JQuery. I've searched many sites, and I'm unable to find examples of lambda expressions in JQuery. Does anyone know if this is possible, and if so where can I find some examples?
Lambda expression are used (among other things) as a shorthand to specifying anonymous functions (also called anonymous delegates or anonymous methods). That is, pointers to function that you define on-the-fly.
See this common JQuery Ajax example:
$.ajax({
url: "test.html",
context: document.body,
success: function(){
$(this).addClass("done");
} });
The success parameter uses Javascript's on-the-fly function definition and pointer. So yes, there is a kindof lambda syntax for anonymous function in javascript. In fact, this is very similar to VB.NET's lambda syntax, used very powerfully for both expression trees and anonymous functions:
Dim newNinjaList = NinjaList.Where(Function(n) n.primaryWeapon = "dagger")
So, you could say there's a lambda syntax in JQuery, though many would consider it inelegant.
If you mean lambda expressions to specify expression trees, then the answer is simple: no, JQuery does not use any kind of lambda syntax for expression trees.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With