Tuesday, August 19, 2014

Previous Interview Question Next Interview Question
Home

which of the following indicates the error with the function below?

function email_checker(addr){
var reg = new RegExp("^[A-Z0-9._%+-]+@ [A-Z0-9.-]+\.[A-Z]{2,4}$");
return reg.test(addr);
}
           a)      The parameter could be null and this code doesn’t check for that
           b)      The code could be in lower case and this code is case sensitive 
           c)       The function returns numeric values rather than true or false,without documenting what                   the values  could be
          d)      The parameter isn’t declaredand will always test false


Answer :  A

Previous Interview Question Next Interview Question
Home

0 comments :

Post a Comment