Here is a brief example of how to use grep in a jQuery script to filter JSON data based on complex (or not) criteria.

This example gets JSON from a test api, prints out the list of names returned. Then, below the horizontal rule, filters the names for any which have "C" as the first letter. Then it prints those.

Here's the html:

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="crossorigin="anonymous"></script>
    <title></title>
</head>
<body>
    <h1>Website</h1>
    <div id="results"></div>
    <hr />
    <div id="grep"></div>

    <script src="index.js"></script>
</body>
</html>

Here's the jQuery:

$(function () {
            var url = "https://jsonplaceholder.typicode.com/users";
            url += "?callback=?";
            $.getJSON(url, function(data) {
                var output = "";
                $.each(data, function (i, obj) {
                    output += "<p>" + obj.name + "</p>";
                });
                $("#results").append(output);

                var grepResult = $.grep(data, function (element, index) {
                  return element.name.substr(0,1) == "C" ;
                  });

                var grepOutput = "";
                $.each(grepResult, function( index, value ) {
                  grepOutput += "<p>" + value.name + "</p>";
                  });
                $("#grep").append(grepOutput);
            });
        });

Hope this helps.