DEV Community

Discussion on: Converting Object to an Array in JavaScript

 
fetishlace profile image
fetishlace • Edited

Thanks for feedback, that makes sense, I know practically nothing about node, just proposed it because thought it is older ECMA and implemented in all V8 based things.
I were searching a bit and found thread (stackoverflow.com/questions/472665...) stating that "Node v10 has built-in availability of URLSearchParams on the global object" but haven't tested, also that qs has sorting function build-in it seems.
Anyway I would go for that vanilla URL object with its possibilities now after all the search since I do not see any added value to that native URL API - sure it can have some value (i mean libraries) when it is about back-compatibility and browsers - i see IE don't know URLSearchParams, but not much surprising :-)

Thread Thread
 
aminnairi profile image
Amin

Yes whenever possible we should thrive to use the built in ECMAScript way of doing things you are right. And you are also right I have mistakenly taken the latest version but it is not used in production in express servers because (at least for us in enterprise) we are using custom delimiters and special encoder for our queries which makes URLSearchParams difficult to use alone. But I would use it in any other cases.

Thread Thread
 
fetishlace profile image
fetishlace

Thanks for explain! ;-) I am going to learn node soon anyway, since I need backend for some of my projects. I am just a bit frightened from number of libraries, packages, modules... I've just started some months ago and I am still just a hobby coder but I really like many things late ECMA brings into JS and I am really vanilla js fan - sometimes there is some sound reasoning behind people using some library, sometimes I have seen there is no other reason than preference or that someone is used to it from the past (when some new ECMA tools did not exist), or just it is more efficient for the use case (and that could be totally different story with another use case) - so it is good to hear why and how professionals using it :-)

Thread Thread
 
aminnairi profile image
Amin

You'll pick Node really easy if you are that interested about the ECMAScript standard I'm sure. And yeah, even myself I tend to use libraries when there is now lots of things that the standard is already doing natively.

Thread Thread
 
fetishlace profile image
fetishlace

Thanks for discussion and some encouragement:-) I will try to befriend Node as soon as possible since ye I have to admit i am postponing it for some time. I am aware on the other hand that some shiny new ECMA features not implemented the best at the time (so some runtimes way better for old ways of doing the same, and compatibility issues...) but it is changing with a time and lot of it is pretty good for doing a lot with a little - what is what you need for prototyping and efficient and fast building of things in general i guess. Good luck with your work too:-)