How to create a function that returns true if a letter in Node.js

1 Answer

0 votes
let isAlpha = function(ch) {
  	return /^[A-Z]$/i.test(ch);
}
        
console.log(isAlpha('w'));

console.log(isAlpha('!'));



  
  
  
  
/*
run:
  
true
false
  
*/

 



answered Aug 25, 2022 by avibootz

Related questions

1 answer 204 views
2 answers 167 views
1 answer 165 views
...