Write a program to check whether a given number is a
palindrome or not?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / annshuk
function isPalidrome(str){
if(str== str.split('').reverse().join())
return str +"is palidrome";
else return str +"try another string";
}
| Is This Answer Correct ? | 0 Yes | 4 No |
How to use "join()" to create a string from an array using javascript?
What is the difference between a web-garden and a web-farm?
What is the purpose of using javascript?
How can you do a character count in javascript?
What is null in js?
What is the difference between scripting and programming?
How can I learn javascript fast?
What are the properties of stack?
What is the use of a weakset object in javascript?
Does javascript care about whitespace?
What is event in javascript?
What are the basic groups of dataypes in JavaScript?