Uh... ps | awk 'NR>1{ print $1, $4}' I'll give that the syntax of these shell programs take some work to understand but they're hard to beat for the purpose they serve. If you're parsing plenty of JSON these days I find 'jq' indispensable. It's basically awk/sed for JSON. I would just be sure to study those programs as they took quite a bit of effort to make them fast. And there are plenty of alternatives with extend…
I'm sorry but that seems to be some of the least intuitive code I have ever seen. What are the practical applications of knowing AWK over knowing JS? (Besides the shell voodoo). I'm not trying to start a language war, I just want to understand why learning a completely new set of grammars with a very limited domain would be worth the effort.
That it is present on pretty much every Unix-like system, and most other platforms with a "real" OS, including platforms where finding a modern Javascript implementation is impossible.
It's also a very small language, and the default of parsing records from standard in and splitting them by a field separator and pattern matching on them makes it very well suited for compact filters without extra seremony (some other interpreters have flags to give an awk-like exerience - e.g. Ruby (MRI) - but none are remotely as likely to be installed everywhere unless you go for more cryptic tools like sed).