anagram javascript example
JavaScript
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;
}function anagram(name, words) {
name = name.toLowerCase().split('').sort().join('').trim();
words = words.join('').toLowerCase().split('').sort().join('');
return name === words;
}function anagram(name, words) {
var a = name.replace(/\s/g,'').toLowerCase().split('').sort().join('');
var b = words.join('').split('').sort().join('');
return a == b;
}
Also in JavaScript:
- Title
- how to read json file with gluegun
- Category
- JavaScript
- Title
- javascript class inheritance
- Category
- JavaScript
- Title
- check when keyup an input from a specific form jquery
- Category
- JavaScript
- Title
- angular email validation
- Category
- JavaScript
- Title
- get id of element javascript
- Category
- JavaScript
- Title
- check first two number jquery
- Category
- JavaScript
- Title
- how to change tag name in js html
- Category
- JavaScript
- Title
- hot get access_token instead of url
- Category
- JavaScript
- Title
- div background image chnage uisng js
- Category
- JavaScript
- Title
- filter array react
- Category
- JavaScript
- Title
- javascript bubleshort example
- Category
- JavaScript
- Title
- angry professor javascript
- Category
- JavaScript
- Title
- connect to existing collection mongoose
- Category
- JavaScript
- Title
- javascript break out of loop
- Category
- JavaScript
- Title
- create an empty array js
- Category
- JavaScript
- Title
- for loop using javascript
- Category
- JavaScript
- Title
- disable copy past jquery
- Category
- JavaScript
- Title
- create react app scaffolding
- Category
- JavaScript
- Title
- javascript base64 encode string
- Category
- JavaScript
- Title
- column gap without affecting width site:stackoverflow.com
- Category
- JavaScript
- Title
- convert 24 hour to 12 hour moment js
- Category
- JavaScript
- Title
- javascrip check if string contains substring
- Category
- JavaScript
- Title
- forin js
- Category
- JavaScript
- Title
- beforeeach jest
- Category
- JavaScript
- Title
- create child element in javascript
- Category
- JavaScript
- Title
- javascript change frame background
- Category
- JavaScript
- Title
- find max and min value in array javascript
- Category
- JavaScript
- Title
- how to refresh the page using react
- Category
- JavaScript
- Title
- dangerouslySetInnerHTML
- Category
- JavaScript
- Title
- javascript check for undefined
- Category
- JavaScript
- Title
- axios download excel \ file
- Category
- JavaScript
- Title
- angular MatDialogRef spec
- Category
- JavaScript
- Title
- how to remove spaces from strings javascript
- Category
- JavaScript
- Title
- async await javascript
- Category
- JavaScript
- Title
- is javascript good
- Category
- JavaScript
- Title
- how to remove a class jquery
- Category
- JavaScript
- Title
- buble sort in js
- Category
- JavaScript
- Title
- ion button transparent
- Category
- JavaScript
- Title
- how the filter() function works javascript
- Category
- JavaScript
- Title
- how to turn number into string javascript
- Category
- JavaScript
- Title
- filter javascript array
- Category
- JavaScript
- Title
- javascript after dom ready
- Category
- JavaScript
- Title
- javascript ajouter une donnée à une list
- Category
- JavaScript
- Title
- display none js
- Category
- JavaScript
- Title
- check to see if number is a decimal javascript
- Category
- JavaScript
- Title
- anagram javascript example
- Category
- JavaScript
- Title
- array data structure javascipt interview questions
- Category
- JavaScript
- Title
- how to check an empty array js
- Category
- JavaScript
- Title
- email regex javscript
- Category
- JavaScript
- Title
- (function (g, d, a) {})(window, document, jQuery);
- Category
- JavaScript
- Title
- javascript array of all countries
- Category
- JavaScript
- Title
- event target javascript
- Category
- JavaScript
- Title
- indexof javascript
- Category
- JavaScript
- Title
- function range() as range js
- Category
- JavaScript
- Title
- disable input angular
- Category
- JavaScript
- Title
- how to make a inventory in js
- Category
- JavaScript
- Title
- how to use the foreach method in javascript
- Category
- JavaScript
- Title
- How to insert an item into an array at a specific index JavaScript
- Category
- JavaScript
- Title
- how to run a cloned react native project
- Category
- JavaScript
- Title
- javascript capitalize words
- Category
- JavaScript
- Title
- form validation in reactstrap
- Category
- JavaScript
- Title
- add element to body javascript
- Category
- JavaScript
- Title
- how to remove duplicate array object in javascript
- Category
- JavaScript
- Title
- create table jquery
- Category
- JavaScript
- Title
- convert boolean to string javascript
- Category
- JavaScript
- Title
- how to know type of dom element in js
- Category
- JavaScript
- Title
- gulp serve Cannot find module 'gulp-sass'
- Category
- JavaScript
- Title
- canvas fillrect
- Category
- JavaScript
- Title
- angular component lifecycle hooks
- Category
- JavaScript
- Title
- data binding on checkbox angular
- Category
- JavaScript
- Title
- convert object to json javascript
- Category
- JavaScript
- Title
- get last item in array javascript
- Category
- JavaScript
- Title
- disregard empty field in array
- Category
- JavaScript
- Title
- int to string javascript
- Category
- JavaScript
- Title
- http request javascript
- Category
- JavaScript
- Title
- faunadb ref
- Category
- JavaScript
- Title
- how to add validator to formgroup
- Category
- JavaScript
- Title
- how to run mocha tests on asynchronous functions in script
- Category
- JavaScript
- Title
- get current directory vbscript
- Category
- JavaScript
- Title
- angular router return back
- Category
- JavaScript
- Title
- Javascript check if undefined
- Category
- JavaScript
- Title
- how to return the number of nodes in a linked list
- Category
- JavaScript
- Title
- function redirect javascript
- Category
- JavaScript
- Title
- iso to date javascript
- Category
- JavaScript
- Title
- chart.js line chart
- Category
- JavaScript
- Title
- hasownproperty.call
- Category
- JavaScript
- Title
- index.js:1 Warning: <feGaussianBlur /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.
- Category
- JavaScript
- Title
- can we give a url to img with jquery
- Category
- JavaScript
- Title
- comment in jsp file
- Category
- JavaScript
- Title
- array length for boolean in javascript
- Category
- JavaScript
- Title
- array insertion javascript
- Category
- JavaScript
- Title
- how to open a new html page on button click in javascript
- Category
- JavaScript
- Title
- javascript character ascii value modify
- Category
- JavaScript
- Title
- conditional chaining chrome
- Category
- JavaScript
- Title
- Error: Can't resolve 'fs' webpack
- Category
- JavaScript
- Title
- create dice game javascript
- Category
- JavaScript
- Title
- const {} = object in javascript
- Category
- JavaScript
- Title
- javascript associative array
- Category
- JavaScript
- Title
- how to convert string to int js
- Category
- JavaScript
- Title
- iterate array javascript
- Category
- JavaScript