diviser un nombre en chiffres javascript

export const parseDigit = (str) => {
  return str.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ' ')
}
Injury