diff --git a/snippets/btoa.md b/snippets/btoa.md index d24508e50..6c4d4531f 100644 --- a/snippets/btoa.md +++ b/snippets/btoa.md @@ -5,7 +5,7 @@ Creates a base-64 encoded ASCII string from a String object in which each charac Create a `Buffer` for the given string with binary encoding and use `Buffer.toString('base64')` to return the encoded string. ```js -const btoa = str => new Buffer.from(str, 'binary').toString('base64'); +const btoa = str => Buffer.from(str, 'binary').toString('base64'); ``` ```js diff --git a/test/btoa/btoa.js b/test/btoa/btoa.js index bdff3b689..7d2ae5545 100644 --- a/test/btoa/btoa.js +++ b/test/btoa/btoa.js @@ -1,2 +1,2 @@ -const btoa = str => new Buffer.from(str, 'binary').toString('base64'); +const btoa = str => Buffer.from(str, 'binary').toString('base64'); module.exports = btoa;