You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//? This program encode a string to Base64 in javascript,you can use the btoa() function to encode a string to base64.
//?The btoa() function is used to convert a string into a base-64 encoded string. The btoa() function takes a string as an argument and returns a base-64 encoded string.
//* method-1
function base64(str) {
let base64EncodedString = btoa(encodeURIComponent(str));