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 :: react proxy to flask server 
Javascript :: javascript etaretot 
Javascript :: jquery add submit button dynamically to form 
Javascript :: merge two array with same length as object 
Javascript :: Sub-routes in Main route not getting static files ExpressJS 
Javascript :: generator object loop over length 
Javascript :: Fromdata 
Javascript :: how to do multiple pages in angular 
Javascript :: javascript promise multi function error 
Javascript :: cellpadding and cellspacing in JSP 
Javascript :: jquery textfill example 
Javascript :: await multiple promises 
Javascript :: Perform native operation by javascript in Android 
Javascript :: 00979fb28f7cc517ff28c035bb8ef10698d0d991304e9901ba214ad0cada69ef:script- 
Javascript :: redux cannot read properties state) = state.useSelector 
Javascript :: blue pring GUI react 
Javascript :: To enable server-to-server and REST tools like Postman to access our API - 
Javascript :: JSX expression with JS template literals 
Javascript :: regular expression for beginners 
Javascript :: jQuery - The noConflict() Method 
Javascript :: How to Compare Strings Using localeCompare 
Javascript :: js rotate matrix as image 
Javascript :: html document from string javascript 
Javascript :: get user id from username discord 
Javascript :: middleware for angular for passing token in header 
Javascript :: asp.net updatepanel autoscroll fix 
Javascript :: javascript foreach next iteration 
Javascript :: get html from url in react js 
Javascript :: how can i debug compressed javascript in chrome 
Javascript :: javascript splice method 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =