You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've had similar challenges with GO arrays converted to JS ones. You need to convert the array to a "TRUE" JS array before "push" and other calls can be made against it. One approach is to "clone" it. This works...
I've done some more research and found the problem (though not solved it)...
A similar problem occurs when trying 'arr[0] = "test"' (though it fails silently) and seems to be because the "setValue" functions in type_go_array.go and type_go_slice.go test that the element already exists before allowing it to be set. This means that you cant change the length an array created in this way.
You can see this by replacing the "push" statement with...
arr[0] = "test"
console.log(arr.length)
Which shows 0 even though the element setting doesnt throw an error
set a method that return a slice as result to vm, but if i call push method in js ,it will report a type error,
how can i resolve it ?
The text was updated successfully, but these errors were encountered: