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));
}
}
Also in Java:
- java add element to existing array
- if en une seul ligne java
- how to minimize jframe in java
- java run project from command line
- java stream sorted reverse
- using get in map in java
- how to check type of primitive value in java
- append to arraylist by index java
- creating a program about user asked to enter a number and enters 0 to stop, then calculates the sum of numbers entered, the average, the length of positive numbers and negative numbers entered by the user in java
- java how to print a string[]
- java call another constructor
- java android development find element by id
- multiplication program java
- imageview.setbackground
- java letter alphabet index
- java unit test an api
- how to play an audio in java
- get current unix timestamp java
- java int stream min
- how to print to the console in java
- detect tv remote keys andoid studio
- map with insertion order preserved java
- java get size of array
- loop through java object