Might be worth elaborating on what you are trying to achieve in your code. And if you can provide the full sketch it's more likely people can advise on your approach.
But, if it works, it is often good enough - at least for me ;)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Might be worth elaborating on what you are trying to achieve in your code. And if you can provide the full sketch it's more likely people can advise on your approach.
But, if it works, it is often good enough - at least for me ;)