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
Difference between window.onload and onDocumentReady?
Is dart better than javascript?
How does typeof operator work?
What is NaN in Javascript?
A milk carton can hold 3.78 litres of milk. Each morning, a dairy farm ships cartons of milk to a local grocery store. The cost of producing one litre of milk is $0.38, and the profit of each carton of milk is $0.27. Write a java program that prompts the user to enter the total amount of milk produced in the morning. Then display the number of milk cartons needed to hold milk, the cost of producing milk, and the profit for producing milk.
Is a parabola a function?
What applications use javascript?
What is js injection?
What are the scopes of a variable in javascript?
What is asynchronous javascript?
How to get the primitive value of a string in Javascript?
What is number in javascript?
Which built-in method sorts the elements of an array?
What are the Advantages and Disadvantages of JavaScript?
Which built-in method returns the index within the calling string object of the first occurrence of the specified value?