JavaScript: Sample Request Reduction June 28th, 2015

    var testData = queryResponse.PrimaryQueryResult.RelevantResults.Table.Rows[0];
    if (testData !== undefined) {
        return testData.Cells;
    }

In this example, testData holds the result of the query so we can use it in a conditional and then return it without having to run the query again and again.