I am working on the Micro:bit. (Well, technically not homework, and I am not asking about the full solution). It can either use a really clunky graphical programming interface, or use a stripped down version of JS. No library importing and/or using multiple files, and from my testing, some language features are stripped, e.g JSFuck doesn't work because using the unary plus operator on a string or a boolean is not allowed.
Now, in a part of the code, I have to use String.fromCharCode(x)
, but I am unsure if it is works or even exists. Well I have tried "ABCD......\b"[64-x]
, but well I may have to extend to support larger charsets. Is there a portable way to implement String.fromCharCode without explicitly include the whole charset in the code?
Sorry everyone, I originally thought it would be unavailable based on the other missing features, but well, it works.