A version of the Laravel Collections library has been released for JavaScript.  This dependency-free library for working with arrays and objects has (almost) the same API as the similarly named library in Laravel 5.6, meaning that we can apply the same knowledge/techniques when working in Laravel or Javascript.

The “(almost)” above refers to the fact that all comparisons in the JavaScript library are done with scrict equality (the data types of the arguments must be the same to be considered equal) which are preferred in JavaScript.  Laravel defaults to “loose” comparisons (data types might be converted before testing equality) and offers optional “strict” counterparts for several methods.   See https://www.copterlabs.com/strict-vs-loose-comparisons-in-php/for info on strict and loose comparisons in PHP.

The library includes a number of methods to satisfy all of your sorting, combining, mapping, filtering, converting and extraction needs for working with arrays and objects.  These will be increasingly useful as we move more interface interaction into the JavaScript layer.  

Here is a made up example from a hypothetical Service Catalog interface:

var sorProducts = collect(products).where('system_of_record', '=', "yes").sortBy('vendor');

Reminder:  React is just JavaScript, so the collect.js library can be used with React components and JSX as well as straight JavaScript.

The README for the collect.js library is at https://github.com/ecrmnn/collect.js/blob/master/README.md