Skip to content

Tag: object

Move specific properties from object to object

I have an object with a lot of properties, lets say: I want to separate a group of properties as follow: What i am doing is: is this the only way to achive this? is there a way to ignore properties that are undefined? For example let say h is undefined, so ideally obj2 would only be obj2={a,w} It is

Object’s values sorted in desecending order

I have this object: Each gladiator has its own abilities and as values are the skill for each ability, I want to print them in desecending order by total skill, this is where I am at the moment: this code prints: I simply want it to print: I want the total skill to be in descending order, if its equal,