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 |
What are javascript closures?
What is the naming conventions for the variables in javascript?
What is a frontend framework?
How to create an object using javascript?
How can javascript be used to personalize or tailor a web site to fit individual users?
Why is javascript hoisting?
Explain escape() in javascript?
List out all the falsifying tokens in Javascript?
How can a particular frame be targeted, from a hyperlink, in javascript?
What is the difference between client side javascript and server side javascript.
what is a difference of subclass and main class
What is the difference between let, const, and var?