How to insert comma after every number in Redux Form Code Answer

Hello Developer, Hope you guys are doing great. Today at Tutorial Guruji Official website, we are sharing the answer of How to insert comma after every number in Redux Form without wasting too much if your time.

The question is published on by Tutorial Guruji team.

I am trying to take input from the user and insert commas after every number. For example if the user types 12345 I want the result to be 1,2,3,4,5. Could someone please help me how to resolve this issue?

Answer

You can use spread syntax and Array#join.

const str = "12345";
const res = [...str].join();
console.log(res);
We are here to answer your question about How to insert comma after every number in Redux Form - If you find the proper solution, please don't forgot to share this with your team members.

Related Posts

Tutorial Guruji