how to convert a binary array to base 64 in javascript code example Example: javascript base64 decode var decodedString = atob(encodedString);