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 create 3-dimensional Array in Javascript?
What is built in function in javascript?
What is the event loop in JavaScript?
What are the properties of stack?
Is javascript object oriented?
Difference between the substr() and substring() in JavaScript?
Where do you write javascript?
How can I learn javascript fast?
Write a program to exaplain the deferred scripts using event handlers in javascript.
What is escape() function?
What is the difference between call & apply?
What makes a relation a function?