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

flatMap()

Use flatMap() creates a new array with sub-array elements flattened by specified depth.

JavaScript: async/await with forEach

JavaScript: async/await with forEach()

Lấy tháng hiện tại trong javascript

Lấy tháng hiện tại trong javascript

Promise + gì

promise + gì

Copy a string to the clipboard

Copy a string to the clipboard. Only works as a result of user action (i.e. inside a click event listener).