Reputation: 13
I'm using linq.js to use LINQ in my JavaScript code. When trying to filter out an array, I'm getting a bogus output. What am I doing wrong?
Code:
console.log($.Enumerable.From(streams.Medias["User Feeds"][a].Streams).Where('x => x.Name.length > 0').Count);
Output (in the browser console):
function (a){a=a==b?g.True:d.CreateLambda(a);var c=0;this.ForEach(function(d,b){if(a(d,b))++c});return c}
Upvotes: 0
Views: 2017
Reputation: 134841
Count
is a function. You must call it to get the value.
var count = $.Enumerable.From(streams.Medias["User Feeds"][a].Streams)
.Where('x => x.Name.length > 0')
.Count();
Upvotes: 1