<script> //btoa() takes a string and encodes it to Base64. // Define the string var decodedStringBtoA = 'Hello World!'; // Encode the String var encodedStringBtoA = btoa(decodedStringBtoA); console.log(encodedStringBtoA); //atob() takes a string and decodes it from Base64. // Define the string var encodedStringAtoB = 'SGVsbG8gV29ybGQh'; // Decode the String var decodedStringAtoB = atob(encodedStringAtoB); console.log(decodedStringAtoB); </script>