Btoa() - Converting an array into a base64 encoded string

Hi all,

According to the API, btoa(..) can convert a string or array into a base64 encoded string:

This works fine for a string (encode and decode):

>atob(btoa("hello world"))
="hello world\x00"

But not for an array:

>btoa([1,2,3])
=""

Any ideas that I am doing wrong? Thanks!