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 203 views
2 answers 159 views
1 answer 161 views
...