JSFiddle - React, Tailwind, and code Playground

HTML

<p class="points">10999</p>

JavaScript

function numberWithCommas(x) {
    return x.toString().replace(/\B(?=(?:\d{3})+(?!\d))/g, ",");
}

var points = $('.points > span').html()

numberWithCommas(points)