Kiểm tra định dạng email bằng Javascript

tipjs,validate

Kiểm tra định dạng email bằng Javascript

let isEmailAddress = val => {
	return /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(val) || /w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*/.test(val);
}
console.log(isEmailAddress('gmail.com@.com'))//false
console.log(isEmailAddress('gmail.com@gm.com'))//true

Có thể bạn đã miss một số snippets code

So sánh hai array trong javascript

Làm thế nào để đánh giá xem hai mảng có bằng nhau không? Có hai cách đó là sử dụng JSON.stringify() hoặc toString()

JavaScript: async/await with forEach

JavaScript: async/await with forEach()

Object.keys và Object.getOwnPropertyNames

Object.keys và Object.getOwnPropertyNames

Ajax, call jQuery POST to node.js expressjs

Ajax, call jQuery POST to node.js expressjs

Spread Operator for Objects

Using the spread operator during an Object declaration will assign the properties of the referenced Object to the new Object.