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
Object.keys is only able to return strings and symbols. As lua tables main contain keys of any type, this is not suitable as a default. (see #39)
However, you can use js.createProxy and a custom metamethod if you need to create an object for a specific API.
Or at least I thought you could.... I'm trying js.createproxy(setmetatable({foo=1, bar=2}, {__index=print, ownKeys=function(o) return js.global:Array("foo","bar") end})) but Object.keys on it returns an empty array (firefox 86.0)
I'm finding that when I convert a Lua table to JS, I can't examine its
keys
. Is there a way of doing this?In Javascript, I would like to type:
The text was updated successfully, but these errors were encountered: