Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js check string for isogram

// Check if a string is an isogram
function isIsogram(str){
   return !str.match(/([a-z]).*1/i);
  //or: return new Set(str.toLowerCase()).size === str.length;
}
console.log(isIsogram("Dermatoglyphics"));//, true
console.log(isIsogram("isogram"));		  //, true
console.log(isIsogram("moOse"));		  //, false
console.log(isIsogram("isIsogram"));	  //, false
console.log(isIsogram(""));				  //, true
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript sum array values 
Javascript :: js generate random numbers 
Javascript :: javascript websocket 
Javascript :: node fs full path 
Javascript :: how remove last letter js 
Javascript :: window bind load jquery 
Javascript :: javascript remove all children with class 
Javascript :: how to call a function with arguments on event listener javascript 
Javascript :: user api testing 
Javascript :: how to show 1 day ago in javascript 
Javascript :: querySelectorAll by id regex 
Javascript :: jqueryreplace content of div 
Javascript :: js array two dimensional 
Javascript :: string reverse javascript 
Javascript :: jquery google 
Javascript :: js get hostname from url 
Javascript :: js window.alert 
Javascript :: how to get unique values from array in javascript without duplicate value 
Javascript :: how to convert array into string in js 
Javascript :: datetime to date moment 
Javascript :: styling element using jquery 
Javascript :: how to store array of object in local storage 
Javascript :: command to delete node modules 
Javascript :: javascript, digit thousand formatting, number formating js, regexp, number comma seperation js 
Javascript :: ajax code 
Javascript :: pass id to reactjs routes 
Javascript :: async await mongoose connection 
Javascript :: react-router-dom redirect 
Javascript :: capitalize first letter of string javascript 
Javascript :: javascript null true or false 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =