Answers for "graal.js pass javascript array to java function"

0

graal.js pass javascript array to java function

Context context = Context.newBuilder("js").build();
Value result = context.eval("js", "var list=[1,2,'foo',true]; list;");
if (result.hasArrayElements()) {
    for (int i=0;i<result.getArraySize();i++) {
        System.out.println(result.getArrayElement(i));
    }
}
Posted by: Guest on May-14-2020

Code answers related to "graal.js pass javascript array to java function"

Code answers related to "Javascript"

Browse Popular Code Answers by Language