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
How do I open a .js file?
Explain the difference between call() and apply()?
What are the main uses of javascript?
Do hackers use javascript?
What does 3+4+"7" evaluate to?
Is null === undefined?
List html dom mouse events?
Why do we need npm?
What is noscript tag?
Can you assign an anonymous function to a variable and pass it as an argument to another function?
How long does it take to learn coding?
What javascript means?
What is a boolean in javascript?
What is differential inheritance?
What is unshift method in JavaScript?