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 difference between java and javascript?
How do functions work in javascript?
What is Date object in JavaScript?
How many types of javascript are there?
What is the use of window object?
How do I disable javascript in my browser?
In which location cookies are stored on the hard disk?
can wwe trace a java program (class)
What are javascript objects?
How to port a GUI application onto Web
What is the difference between an array and an object?
What is the difference between write and writeln in javascript?
Explain export & import in javascript?
What happens when the recursion calling is applied on two functions?
What do you use javascript for?