0

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?

he77789
  • 101
  • 4
  • 1
    "Unsure is it works or exists", so you have not tried it then? What you posted you tried doesn't really make sense as the method takes ASCII codes, not chars. Post code and the results of your attempts(s) plus any the related errors, that would be a good start. p.s. String.fromCharCode() is a standard JS function. – JDunken Oct 24 '19 at 12:53

1 Answers1

-1

Sorry everyone, I originally thought it would be unavailable based on the other missing features, but well, it works.

he77789
  • 101
  • 4