What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-03 10:58:01
How do you detect whether or not a word is a palindrome in javascript
function palindrome(str) { // Step 1. The first part is the same as earlier var re = /[^A-Za-z0-9]/g; // or var re = /[\W_]/g; str = str.toLowerCase().replace(re, ''); // Step 2. Create the FOR loop var len = str.length; // var len = "A man, a ... Add solution -
Javascript 2021-09-02 22:15:02
write a javascript function that converts the first letter of every word to uppercase
//capitalize only the first letter of the string. function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } //capitalize all words of a string. function capitalizeWords(string) { return string.repl... Add solution -
-
Javascript 2021-09-01 04:21:03
anagram js
function isAnagram(stringA, stringB) { // Sanitizing stringA = stringA.toLowerCase().replace(/[\W_]+/g, ""); stringB = stringB.toLowerCase().replace(/[\W_]+/g, ""); // sorting const stringASorted = stringA.split(""... Add solution
Best helpers
Ranking is empty