Convert data for JavaScript