How might window.btoa() be implemented in JS?
/**
* @param {string} b
* @returns {string}
*/
const btoa = (b) => {
let s = '';
const bytes = new Uint8Array(b.split('').map(x => x.charCodeAt(0)));
const ALPHABET_TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567...
blog.fuadolatunji.me1 min read