Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

find common characters in two strings javascript

var s1 = "abcd";
var s2 = "aad";
var count=0;
function match(s1,s2)
{
for(let i in s1)
s2.includes(s1[i])?count++:false;
console.log(count)
}
match(s1,s2)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #common #characters #strings #javascript
ADD COMMENT
Topic
Name
3+5 =