Easy linq.js, GroupBy with Count

Feb 5, 2014 at 7:28 PM
Sorry for the easy question, but I have a simple question, and being new to javascript, jquery and linq.js it's proving difficult for me.

I have a simple array, as defined below in C# code, I want to use linq to return the array elements with a count of how many times it appears in the array.

in C# this is how it would work
var wordList = new List<String> { "test", "one", "test", "two" };
var grouped = wordList
.GroupBy(i => i) //Group the words
.Select(i => new { Word = i.Key, Count = i.Count() }); //get a count for each

how would I code the same thing in linq.js, using Jquery?