Posted By

sergiomas on 07/08/06


Tagged

math


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

xaviaracil
meth


Comprobar si un valor es un número entero


 / Published in: JavaScript
 

  1. esEntero: function(valor){
  2. if(!isNaN(valor)){
  3. for(var i = 0; i<valor.length;i++){
  4. if(valor.charCodeAt(i)<48 || valor.charCodeAt(i)>57)
  5. return false;
  6. }
  7. }else{
  8. return false;
  9. }
  10.  
  11. return true;
  12. }

Report this snippet  

You need to login to post a comment.