A third option, with elemental2-core, rather than explicitly copying the array, ask the browser to do it for you with slice(). First cast the array to JsArray<JsNumber>, then slice it to get a copy of its contents, without the expandos.
JsArray<JsNumber> nodesJsArray = Js.cast(nodes);
JsNumber noExtraProperties = nodesJsArray.slice();
This can be handy when passing the int to something which refuses to handle extraneous properties, like window.postMessage. Yes, it is confusing that it appears you actually end up with a Java array, but it will not have those extra properties in this case.
On Tuesday, December 19, 2017 at 5:02:48 AM UTC-6, cesar paulo alves wrote:
And when I do the same with Js I don't have this garbage (obvious).
I already used the JsArray and everything, but no luck =/.
Thanks a lot.
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org.
To post to this group, send email to email@example.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.