44
phiter
3y

To all C# devs out there who also write some js, I'm not sure if y'all know about linq.js, but the thing is amazing. If someone already uses it I'd like to know if there are any reasons not to use or if there is a better similar library.

Comments
  • 3
    I'd use a dark theme on notepad.exe if it was possible.

    This is a print of the docs xD
  • 0
    I mean the actual notepad not the pumped up dev version
  • 3
    Shut up and take my money!
    LINQ rocks and now it is on Js
    Something to play with tonight, thank you :)
  • 1
    Didn't know it existed, thanks for the heads up!
  • 1
    The image above shows functions as parameters but you can use lambda expressions as well since ES6. So it'll work just like in C#.
    I never worked with nodejs but I think this could be used server side too with little modifications.
  • 1
  • 1
  • 0
    I would love if there is a transpiler which allows you to write actual LINQ which gets translated to these functions. :)
  • 0
    @arekxv I don't understand what you meant. But the functions are all the same as of Microsoft's
  • 1
    @phiter I mean that it will allow you to use full linq query and not function calling the way it does now.

    In other words, a transpiler which translates:
    let result = from jsonArray where x => x.user.id > 5 select x.user.name;

    Into:
    let result = Enumerable.From(jsonArray).Where(x => x.user.id > 5).Select(x => x.user.name);

    :)
  • 0
    aaaaah, I understand now. I prefer function linq over the other syntax... I think it's easier to understand.
    But yeah that'd be awesome
  • 2
    this is literally wrapping existing functions:

    Where() = filter()
    OrderBy() = sort()
    Select() = map()
  • 0
    @rephiscorth yeah but for someone who is highly used to C#'s LINQ this will fit like a glove <3
  • 2
    What is the point of this? Doesnt JS already have this stuff built in?
  • 0
    @danielspaniol the point is exactly what I mentioned in the previous comment.
    People like the idea of writing js in the front and back end, that's why nodejs is so popular.
    I like the idea of working arrays and objects in js the same way I do in the backend
  • 0
    @arekxv hey sorry I'm late, but take a look at Babel, it does exactly that. It converts ES6 features (like lambda) into older code, with function calling in this example
Add Comment