check if anagram
function isAnagram(stringA, stringB) {
// Sanitizing
stringA = stringA.toLowerCase().replace(/[\W_]+/g, "");
stringB = stringB.toLowerCase().replace(/[\W_]+/g, "");
// sorting
const stringASorted = stringA.split("").sort().join("");
const stringBSorted = stringB.split("").sort().join("");
return stringASorted === stringBSorted;
}
Also in JavaScript:
- javascript add update query parameter to url
- ngmodel div angular 7
- remove axis tick ends d3
- set value of input in javascript
- how to check if an element exists in an array of objects js
- js yield*
- puppeteer block request javascript
- update node mac to specific version
- terser
- angular generat model
- communication child to parent react js
- styling element using jquery
- javascript float to int
- javascript wait 5 sec
- javascript log to console
- mobile number format (xxx) xxx-xxxx
- setting property to method in child class javascript
- Javascript format date / time
- discord js fetch user
- v-btn click
- how to check if window size of browser s changed javascript
- how to proxy enable in server nodejs
- angularjs class directive prepend
- nest winston