You can only send primitive datatypes (text, numbers, dates, etc.) or Bubble datatypes (custom Datatypes, Option Sets, or Api data) to a Javascript to Bubble element.
There is no way in Bubble to work with non-Bubble objects (aside from doing everything completely in custom code… at which point, there’s little point in using Bubble at all).