Implement a Currency Formatting Utility | JavaScript Interview Question
@Yomesh Gupta

JavaScriptBeginner
411
Do you see value in our efforts?

Devtools Tech is a free platform for Frontend Engineers. It takes a lot of time, effort, and finanical resources to keep the platform running. If you see any value in our work and would like to support us then you can do using the following options.

InternationalDomestic

You have to implement a simple currency formatting utility.

function format(n) {
    ....
}

const responseOne = format(123456789);
// 123,456,789

const responseTwo = format(123);
// 123

Please take care of edge cases too.

Loading IDE...