Answer Posted / rajender
function isEmail (s) {
if (isEmpty(s))
if (isEmail.arguments.length == 1) return defaultEmptyOK;
else return (isEmail.arguments[1] == true);
if (isWhitespace(s)) return false;
var i = 1;
var sLength = s.length;
while ((i < sLength) && (s.charAt(i) != "@")) {
i++
}
if ((i >= sLength) || (s.charAt(i) != "@")) return false;
else i += 2;
while ((i < sLength) && (s.charAt(i) != ".")) {
i++
}
if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
else return true;
}
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
Why javascript is so popular?
Which is faster jquery or javascript?
How does typeof operator work?
What is the requirement of debugging in javascript?
How will you get the checkbox status whether it is checked or not?
Can you explain how inheritance works in javascript?
What is the scope variable in javascript?
How will you explain closures in javascript? When are they used?
What is use of flutter?
How to disable an html object ?
What is console.time() and console.timeend()? What is its syntax, and why is it used?
What is the meaning of callback function?
What typeof returns for a null value?
How to define a named function in JavScript?
What is the way to get the status of a CheckBox?