第191天 举例说明atob和btoa的用法
```javascript
// Define the string
var string = 'Hello World!';
// Encode the String
var encodedString = btoa(string);
console.log(encodedString); // Outputs: "SGVsbG8gV29ybGQh"
// Decode the String
var decodedString = atob(encodedString);
console.log(decodedString); // Outputs: "Hello World!"
```

将字符串转换成base64编码、或者解码。
btoa('hello') //"aGVsbG8="
atob('aGVsbG8') //"hello"
// 对于超过 Latin1 范畴的字符,可以使用 encodeURI/decodeURI 进行转换:
btoa(encodeURI('字')) // "JUU1JUFEJTk3"
decodeURI(atob('JUU1JUFEJTk3')) // "字"
Most helpful comment
是window的两个对象,btoa:binary to ascii;(base64的编码) atob:ascii to binary;(base64的解码) 无法用于Unicode字符
示例
```javascript
// Define the string
var string = 'Hello World!';
// Encode the String
var encodedString = btoa(string);
console.log(encodedString); // Outputs: "SGVsbG8gV29ybGQh"
// Decode the String
var decodedString = atob(encodedString);
console.log(decodedString); // Outputs: "Hello World!"
```