[javascript] Best way to alphanumeric check in JavaScript