JSFiddle - React, Tailwind, and code Playground

JavaScript

var number = 3500;

console.log(new Intl.NumberFormat().format(number));
// → '3,500' if in US English locale