This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cat = function(obj){ | |
//this is where I copy all the attributes of the passed object to the constructure | |
for (attr in obj){ | |
this[attr] = obj[attr]; | |
} | |
//publice method | |
this.talk = function(){ | |
console.log('meeow!!!'); | |
}; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var validator = (function () { | |
function trim(str) { | |
return str.replace(/^\s+|\s+$/g, ''); | |
} | |
function isEmail(field) { | |
if (field) { | |
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; | |
if (!filter.test(field)) { | |
return false; |
NewerOlder