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

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

Merge Array

How to combine two sorted arrays into one? We can do this easily with the spread operator.

Làm phẳng mảng dùng phương pháp đệ quy

Làm phẳng mảng dùng phương pháp đệ quy

Rest Operator for Objects

Now we can use rest on the properties of an Object. It allows us to explicitly extract certain named variables, and assign any uncalled variables into a catchall Object.