That doesnât look like any JavaScript Iâm familiar with. It looks more like Java to me. Obviously Iâm not understanding the situation. Please explain.
Also, I do not know what youâre asking by âadd more options - place your codeâ.
Forum members are not as likely to âdo your work for youâ as they are to help you do your work. If you explain what problems you are having there is a better chance of getting helpful replies.
The thread topic is âhow can I convert base64 decode a string to text in javascript fileâ, so I will answer that question: The function atob decodes base64.
var mystring = "SGVsbG8gV29ybGQ=";
console.log(atob(mystring)); //Logs "Hello World".
The function btoa encodes a string in the same manner.
Going backwards System.out.println(decodedString);
uses the variable from String decodedString = new String(decodedByte);
uses the variable from byte[] decodedByte = decoder.decode(encodedString);
I see no variable named encodedString. A name mismatch ? with String str = "R28gVG8gSGFja2Jhcg=="
Admittedly my Java is rusty, but shouldnât there be a statement end for that line?