JSFiddle - React, Tailwind, and code Playground

by Fernando Leal

HTML

<script src="http://hugoware.net/resources/projects/jlinq/jlinq.min.demo-version.js"></script>

CSS

body { white-space: pre; font-family: monospace; }

JavaScript

var dataString= '['+
 '{ "category" : "Search Engines", "hits" : 5, "bytes" : 50189 },'+
 '{ "category" : "Content Server", "hits" : 1, "bytes" : 17308 },'+
 '{ "category" : "Content Server", "hits" : 1, "bytes" : 47412 },'+
 '{ "category" : "Search Engines", "hits" : 1, "bytes" : 7601 },'+
 '{ "category" : "Business", "hits" : 1, "bytes" : 2847 },'+
 '{ "category" : "Content Server", "hits" : 1, "bytes" : 24210 },'+
 '{ "category" : "Internet Services", "hits" : 1, "bytes" : 3690 },'+
 '{ "category" : "Search Engines", "hits" : 6, "bytes" : 613036 },'+
 '{ "category" : "Search Engines", "hits" : 1, "bytes" : 2858 } '+
']';

var data = JSON.parse(dataString);

var result = jlinq.from(data).useCase().group("category");

document.body.innerHTML = "";
document.body.appendChild(document.createTextNode(JSON.stringify(result, null, 4)));