Software Engineer. Full-time Nerd 🤓 I use React, Typescript, Redux, AWS Serverless Lambdas and DynamoDB. I sometimes eat Pizza 🍕

Joined September 2020
It's hard to know what your trying to do but you can use Object.entries and Object.fromEntries to convert it to an array do something to it and then convert back to an array but you may have problems with nested objects and may need to use something like lodash or recursion
1
1
Replying to @LinuxSeb
Sure, if anyone wakes you just say you were meditating on the complexities of the universe and they just ruined your life changing breakthrough. Then tell them to go away and go back to sleep 😎
1
I find my cats are usually quite catatonic when they try to code 😎
Replying to @TheJackForge
I love typescript but I'm working on my neckbeard game. Soon when I get to master level at it I'll be like this
3
So when added all together in the shorter syntax you would get back to this and the final object returned would look like the finalObject in the second pic
1
1
basically object.entries and the .filter shown will return an array without the sub array of ["twitter": "myspace"] in it. This is then turned back into an object with Object.fromEntries and it would doing this in reality
1
1
Here the destructuring is done straight away inside the () of the arrow function this works the same way as the previous 2 tweets but without the {} it will return by itself without the return keyword
1
1
To make this clearer this shows what the value is in each loop
1
1
This shows destructuring key and value from each sub array (entry) developer.mozilla.org/en-US/… note that i've used {} in this arrow funtion so I need to use the keyword return to return properly
1
1
the arrow function like => will return the result straight away so the new array returned from filter will be
1
1