Comments (2)
If you mean native js array, then no. You can, however, pass a pointer to a []interface{} which will be represented as a host object similar to an array:
vm := goja.New()
a := []interface{}{10, 20, 30}
vm.Set("a", &a)
vm.RunString("a.push(40)")
fmt.Println(a) // prints [10 20 30 40]
from goja.
I hope this answers your question, @matwachich Feel free to open another ticket if you have any further questions.
from goja.
Related Issues (20)
- Posibility to access goja bytecode and native fields of compiled programs HOT 1
- run javascript long time HOT 1
- Runtime is nil in func(goja.FunctionCall, goja.Runtime) goja.Value
- Issue when compiling typescript 5.0 compiler HOT 8
- Store object using SharedDynamicObject HOT 1
- Implement async/await syntax HOT 19
- Functions defined in js eventually be released safely? HOT 1
- Question:Why JSON.parse of goja doesn't use json.Unmarshal in the golang standard library? HOT 1
- Buffer is not defined HOT 2
- new Date().toString() returns shortened timezone HOT 2
- AssertFunction fails for object.function_name HOT 2
- Wrapping map in a type breaks toValue after 6c0d9883792e42e6da320ac03ae0d6c1b0cd7530 HOT 2
- Error parsing typescript 5 compiler code with goja
- A problem with AsyncContextTracker HOT 5
- Can I do `sleep` and can I generate random numbers? HOT 1
- `AsyncContextTracker.Resumed` not called if returning from an async function HOT 9
- Modifying objects in javascript fails silently HOT 5
- Object not being added to array as expected HOT 7
- Stack incorrect after recursive RunProgram calls HOT 2
- Modify nodes and export new JS code HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goja.