A single function to add, update, read & delete from an array
/**
* Perform CRUD on arrays of objects
* @param {array} arr - Input array
* @param {string} cmd - Operation to perform
* @param {string} payload - Element with the data
*/
const crux = (arr = [], cmd, payload) => {
if (!arr) return [];
if (...
codedrops.hashnode.dev1 min read