JSFiddle - React, Tailwind, and code Playground

by tjnicolaides

JavaScript

var myArray = [{
    "color": "blue",
        "size": "large",
}, {
    "color": "red",
        "size": "small",
}, {
    "color": "blue",
        "size": "small",
}, {
    "color": "green",
        "size": "small",
}];

var myNewArray;
// 1. filter out all non-blue objects, then
// 2. replace property names "color" with "myColor" and "size" with "mySize"