Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

10.8.1.2. The isPalindrome Function

/*Using our reverse function for strings, we can create our palindrome 
checker. Recall that our approach will be to take the string argument, 
reverse it, and then compare the reversed string to the original 
string.*/

function reverse(str) {
   return str.split('').reverse().join('');
}

function isPalindrome(str) {
   return reverse(str) === str;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: usehistory forceRefresh 
Javascript :: add margin letf to badge in angular material 
Javascript :: deez 
Javascript :: sorting json array by key in angular 9 
Javascript :: Amazon Cognito domain on amplify not pulling 
Javascript :: javascript formdata include object 
Javascript :: validate date 
Javascript :: jquery add number as id variable 
Javascript :: await fetch data componentdidmount 
Javascript :: next field 
Javascript :: javascript fix errora 
Javascript :: modulos nodejs 
Javascript :: declarative language example 
Javascript :: expect(insTypeDB).is.to.equals(61) on javascript 
Javascript :: queen of spain 
Javascript :: contentful rte edit link type 
Javascript :: go over each line in text nodejs 
Javascript :: can i use pipe in switch statement javascript 
Javascript :: Nodemon e criando o Servidor com express 
Javascript :: dynamic operator javascript if statement 
Javascript :: pragmatic view on the meaning of life 
Javascript :: title after load undefined nuxtjs 
Javascript :: swapping java primitives values 
Javascript :: check if key in dictionary javascript 
Javascript :: calling computed function inside methods 
Javascript :: can i use promise.all conditional in vue js 
Javascript :: json schema script 
Javascript :: react foreach loop 
Javascript :: flatpicker not focusing in modal React 
Javascript :: format currency javascript 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =