Yes it works.
The javascript code in compiled games works on mobile; what isn’t allowed by Google and Apple is editing and executing code inside the app. Letting users edit code in-app could allow them to inject code that might break the sandboxing that Google & Apple are trying to secure.