rubiyakhadkaa123 rubiyakhadkaa123
  • 20-11-2021
  • Computers and Technology
contestada

Develop an algorithm and draw a flowchart to determine and input number is palindrome or not.​

Respuesta :

PhysicsGirl
PhysicsGirl PhysicsGirl
  • 20-11-2021

function checkPalindrome(str){
let reversed = str.split("").reverse().join("")
return str === reversed
}
let str1 = "anna"
let str2 = "banana"
let str3 = "kayak"
checkPalindrome(str1)
// -> true
checkPalindrome(str2)
// -> false
checkPalindrome(str3)
// -> true
Answer Link

Otras preguntas

Which of the following is true about natural selection? A. Natural selection usually causes a species to change suddenly. B. Natural selection does not cau
Is Jupiter's pull of gravity stronger or weaker than Earth's? Explain your reasoning.
Yann and Camille go to a restaurant. If there are 10 items on the menu, and each orders one dish, how many different combinations of meals can Yann and Camille
explain how you know 6/6 and 1 are equivalent
idk how to do it!! plz help!!
Which pronoun best completes the sentence? How is the pronoun used? The instructor gave Dylan and __________ some good pointers. A. I; direct object B. me; dire
The Dickin Medal, bearing the words 'We also serve' and 'For Gallantry', is awarded to which members of the armed forces in the UK?
how many times thicker is earth's mantle than the thickest part of earth's crust
How are 55:100 and 66:120 equivalent?
Humanism placed the value on which of the following? A. the individual B. the Church C. political authorities D.reason