3 ms·
> Cost of implementing Lua tables, meta-tables Tables and meta tables are nearly identical to objects and prototypes in javascript. Why would the cost of impl
by kybernetikos 11y ago
> Cost of implementing Lua tables, meta-tables
Tables and meta tables are nearly identical to objects and prototypes in javascript. Why would the cost of implementing them be high?
- fanf2 11y agoJavaScript objects are indexed by strings. Lua tables are indexed by arbitrary objects. In JS a[1] and a["1"] are the same element but they are different in Lua. In Lua a[{}] is a new element indexed by the identity of the new object literal, and will be a different element every time the expression is evaluated.