convert json to base64 javascript

Solutions on MaxInterview for convert json to base64 javascript by the best coders in the world

showing results for - "convert json to base64 javascript"
Andrea
03 Jan 2018
1const json = { "a": 1, "b": 2 }
2const string = JSON.stringify(json) // convert Object to a String
3const encodedString = btoa(string) // Base64 encode the String