Addressing the heart of my issue:
[
{amount: 0, name: "", icon: "", description: ""} // default object inserted into array
{amount: 1, name: "kjfhdkfjh", icon: "67", description: "dasdasd"}
]
I am seeking guidance on utilizing lodash find to determine whether an object should be considered "empty" based on the presence of non-zero or non-empty string values in any key.
In this scenario, using lodash find would result in:
[
{amount: 1, name: "kjfhdkfjh", icon: "67", description: "dasdasd"}
]
Alternatively, it could return undefined.
This is what I currently have:
lodashFind(theArray, function(obj){
// How do I proceed to iterate through the objects?
});
I am uncertain how to iterate over the objects and implement a logic that returns an object if amount is not 0 and no strings are empty.
Any suggestions?