Regular expressions of ECMAScript's (Unicode-based) IdentifierName
production (per
latest available Unicode version, currently 10.0.0).
const {IdentifierName} = require('es-identifiers');
IdentifierName.test(aPurportedIdentifier);
<script src="node_modules/es-identifiers/dist/es-identifiers-browser.js">
ESIdentifiers.IdentifierName.test(aPurportedIdentifier);