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 |
program showing string concatenation?
What is camelcase in programming?
How to you change the title of the page by javascript?
How do I turn on javascript on my phone?
How to set a html document's background color?
How do I open a website code?
How to open url in a new tab in javascript?
How to create objects in JavaScript?
WHAT IS .NET?
How do you access an element in an HTML document with JavaScript?
What is dhtml in javascript?
What is shift() method in javascript?