The toLocaleString() method of a number returns the number as a string formatted in the anguage variable passed in. If no anguage varaible is passed in, local language format is used.

    
    const number = 1000000;

    const numberLocaleString = number.toLocaleString();
    console.log(numberLocaleString)
    // "1,000,000"

    const numberArabic = number.toLocaleString('ar-EG')
    console.log(numberArabic);
    // Expected output: "١٢٣٬٤٥٦٫٧٨٩"

    const numberUsCurrency = number.toLocaleString("en-US", {style:"currency", currency:"USD"});
    console.log(numberUsCurrency);
    // $1,000,000.00