Long ID's in Javascript
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2018
07:45 PM
What is the suggested way to deal with the very long ID's that Canvas creates in JavaScript? For example, if I try to parse this response (from a list of courses), Javascript rounds the ID up to 60780000000000040, rather than the expected 60780000000000037.
const str = '[{"id":60780000000000037,"name":"This is a test","account_id":60780000000000198}]'
console.log(JSON.parse(str)[0].id)