Skip to content

Instantly share code, notes, and snippets.

@tvc97
Last active April 6, 2021 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tvc97/accbb79f598e4c482d6cf1250a961f0b to your computer and use it in GitHub Desktop.
Save tvc97/accbb79f598e4c482d6cf1250a961f0b to your computer and use it in GitHub Desktop.
req = new XMLHttpRequest()
req.open('GET', 'https://tiki.vn/api/v2/me/orders?page=1&limit=5000', false)
req.send()
a = JSON.parse(req.responseText)
total = a.data.reduce((prev, next) => next.grand_total + prev, 0)
Intl.NumberFormat('vi-VN').format(total)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment