0

Hi How can i replace multiple string in javascript? for example replace 1 to 34 and 2 to 37

 function code(str){
   str.replace('1','34');str.replace('2','37');str.replace('3','36');str.replace('4','31');str.replace('5','30');str.replace('6','33');str.replace('7','32');str.replace('8','3d');str.replace('9','3c');str.replace('0','35');

    return str;
}
console.log(code(123))
Yusuf HR
  • 92
  • 2
  • 10

0 Answers0