That example is not instructive of concepts and is buggy.
Curl fetches only one line without EOL so it works. But mapping only just one line of input to json is not good way explaining the concept of 'map' function.
As soon as I tried mapping more then one line pretty.js has crashed in json parser on syntax error because es.split() has correctly generated empty string after last EOL terminating last line.
That example is not instructive of concepts and is buggy.
Curl fetches only one line without EOL so it works. But mapping only just one line of input to json is not good way explaining the concept of 'map' function.
As soon as I tried mapping more then one line pretty.js has crashed in json parser on syntax error because es.split() has correctly generated empty string after last EOL terminating last line.