Write a program to check whether a given number is a
palindrome or not?
Answer Posted / abhijeet gupta
var num=123211;
var str=""+num;
for(var i=0;i<str.length/2;i++){
if(str.charAt(i)!==str.charAt(str.length-1-i)) {
console.log("Not Palindrome");
return;
}
}
console.log("palindrome")
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
What does question mark mean in react?
How to get the contents of an input box using javascript?
Explain javascript accessors ?
What is the difference between the operators ‘==‘ & ‘===‘?
What is a boolean search?
What is the data type of variables of in javascript?
Which is faster jquery or javascript?
How to write a function in javascript?
Can I learn javascript without html?
What is the use of type of operator?
what does javascript null mean?
How do you implement Ajax using hide() function in JQuery?
What is the difference between the keywords var and let?
Can you explain the difference between call and apply?
What is escape & unescape String functions in JavaScript?