I am working with an Array of Items, each of which has a set of Properties. One specific property is called config: object[]
, which is an array of Objects.
While I usually provide the complete object with the correct config
array of objects, there are times when I need to pass different config options for certain tests. For instance, wrong config array
, empty array
, etc.
Below is my code snippet:
const connectionResources = [Array.forEach(object => object.config === [])]
connectionResources.forEach(builtInOptions => console.log(builtInOptions))
This is what I have attempted so far. I tried to spread the Array, but unfortunately, it did not work as expected.
Could someone offer some guidance on how to achieve what I am aiming for? Essentially, I want the Array of Objects to have an empty config array property instead of the original object. How can this be accomplished?