Skip to content

Instantly share code, notes, and snippets.

@Cauterite
Created February 8, 2017 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cauterite/dadc15a1ac0721878b15a3e4955e6076 to your computer and use it in GitHub Desktop.
Save Cauterite/dadc15a1ac0721878b15a3e4955e6076 to your computer and use it in GitHub Desktop.
valid ANSI characters in JS identifiers
[...Array(256).keys()]
.map(X => String.fromCharCode(X))
.filter(X => !/\s/.test(X))
.filter(X => {
try {
eval(`() => {let _${X} = 0;}`);
} catch (Err) {
return false;
};
return true;
})
.join(``)
;
// $0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzªµºÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment