0

I am new to javascript, i am trying to call function while login time, but i am getting error in browser console in IE11.

function myLogin(){
    alert("login alert89");
    var str =document.getElementById("j_password").value;       
    var enc = window.btoa(str);

var chars = {'a':'b','b':'c','c':'a'};
var new1;
new1 = enc.replace(/[abc]/g, m => chars[m]);
    document.getElementById("j_password").value=new1;

}

I am getting systam error at new1 = enc.replace(/[abc]/g, m => chars[m]) line. But is working in chrome. What's wrong in my code?

Durga
  • 545
  • 7
  • 21
  • 39

0 Answers0