What is the best way to transform a key : value object to values only array in Javascript? I'm trying to perform a mongoose query using $in. As far as I know, I need to transform this:
[ { "key": "54ce3bef2d1ce6a82c90ccc3" }, { "key": "54d290a23eff5da01d05fe53" } ]
to this:
[ "54ce3bef2d1ce6a82c90ccc3", "54d290a23eff5da01d05fe53" ]
Should I loop through the first one and then create the second one in the loop? Or should I use some map function (eg. $.map())? Is it wise to perform this operation client side or should I do all the work server side? Source object can grow as much as a few thousand pairs.