Skip to content

Tag: object

How to group nested array of objects in js

I have a nested array of objects. I’m trying to group product objects that have the same value. Each objects has a vendor property containing an email. I am trying to group the objects by matching vendor email This is how my database looks like: I am trying to do it with the reduce method but the proble…

Get Names of Array of Objects without Looping

I have an array of country objects (countries) and I’m trying to get just an array of the String names, so from this example: Just: [‘Canada’, ‘USA’, ..] etc. I’m trying to do this with but I can’t seem to get it. Any suggestions? Answer You’re quite close to ge…

javascript typescript create a object

i have a property like this “data.property” = “16165456”.. i try to create a object like this i use split and and loop but not work Answer A few issues: currentObject[part] = currentObject[part] is a statement that accomplishes nothing. You’d want to indicate what to assign when …