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
What is an Event Bubbling in Javascript?
What are self Executing Functions?
How to convert numbers to strings using javascript?
What do you understand by this keyword in javascript?
What is the difference between undefined and object?
Can I write javascript in notepad?
How will you create new object in javascript?
Is javascript necessary?
What are self invoking functions?
What is the difference between .call() and .apply()?
What is the difference between firstChild and firstElementChild?
What are limitations in javascript?
Javascript, Pass by Value or Pass by Reference?
How do I run javascript in chrome?
How fast can you learn coding?