Update convertJsonToCsv.js

Fixed a bug, and used an alternative way to output parsed results.