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 is the output of 10+20+”30″ in JavaScript?
What is the difference between let and var?
What is whitespace in javascript?
What is javascript tree shaking?
What are javascript closures?
What is the difference between childNode and children?
Which software is used for javascript?
What is the default scope in javascript?
How to enabled 'Strict' mode in JavaScript?
How to write a script for "select" lists using javascript
Is JavaScript case sensitive? Give an example?
Explain arrow functions?
What is the role of a strict mode in javascript?
How can the os of the client machine be detected?
What are different types of popup boxes available in javascript?