feat(btoa): port and modify from Array.findindex

So does here.