Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

checkPalindrome

function checkPalindrome(inputString) {
    if (inputString === inputString.split('').reverse().join('')) {
        return true
    } else {
        return false
    }
}
console.log(checkPalindrome('aba')) //output: true
Comment

isPalindrome

var isPalindrome = function (x) {
  const stringfyX = String(x)
    .split('')
    .join('')
  const reverseX = String(x)
    .split('')
    .reverse()
    .join('')
  if (stringfyX === reverseX) return true
  return false
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: redux store as number instead of string 
Javascript :: npm run watch-poll 
Javascript :: PlayerInteractEntityEvent get called twice 
Javascript :: javascript play many background music 
Javascript :: selected css based on route react 
Javascript :: cache variables that need calculation 
Javascript :: paamayim nekudotayim 
Javascript :: create react element with string 
Javascript :: find first and last occurence in knockout js template 
Javascript :: complex type in javascript and memory allocation 
Javascript :: reflection of an graph javascript 
Javascript :: append new element for each value in array d3.js 
Javascript :: why does my react project dosent have any class 
Javascript :: UI-router accessing parent state from child 
Javascript :: No provider for HTTP! { HTTP Native} 
Javascript :: cookie sprites with pure white background 
Javascript :: how to wait for an exec command to fininsh in nodejs 
Javascript :: js queryselector get elements with empty attribute 
Javascript :: jquery dialog button text set by variable 
Javascript :: react native anination 2 valuse 
Javascript :: express js continous GET /json/version 
Javascript :: how to create nav tab with javascript with validation to move to the next tab 
Javascript :: how can prevent morgan to work in test enviroment 
Javascript :: how to add json datasource in jasperserver 
Javascript :: push a new route only triggers URL change but not location change 
Javascript :: tableau javascript 
Javascript :: js remove first element from string 
Javascript :: calculate string value in javascript 
Javascript :: how long does razor burn last 
Javascript :: hark javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =