Implement a Currency Formatting Utility | JavaScript Interview Question
@Yomesh Gupta
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.