Is there a C#-like lambda syntax in JavaScript?

后端 未结 6 659
生来不讨喜
生来不讨喜 2020-12-02 12:13

Is there a framework or post processor for JavaScript that supports lambda syntax like in C#?

Function definitions in CoffeeScript seem to look like lambdas but I ha

6条回答
  •  一生所求
    2020-12-02 12:25

    I started creating an extender for jQuery which does exactly the thing you are asking. JS-Lambda

    For example in C#:

      coll.TakeWhile(x => x.index < 3);
    

    Looks like:

     $(coll).TakeWhile("x => x.index < 3");
    

提交回复
热议问题