I already know the answer to this question; i.e since functions are objects they can't be inside of records or tuples.
But what I really wanted to know is whether or not it's possible to have methods in records in some way?
I would say methods declared within records are frozen by default.
so something like:
const myRecord = #{
myMethod() { }
}
// this get's converted to
const myRecord = #{
myMethod: Object.freeze(function() { })
}
The context / 'this' keyword inside of the function would work as it would in any frozen object.
Is it a viable option? I just really want methods inside of records because without them I don't really see myself reaching out to them over an array or pojo.