Does something like this exist for Javascript? In particular I am looking for a function that tests whether a character is CJK or not.
You can use JavaScript regular expressions to check for Unicode ranges. The challenge is that Unicode uses UCS-2 internally, and EMCAScript 5 doesn't handle surrogate pairs.
Thankfully, there's https://mths.be/regenerate/.