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'))//trueCó thể bạn đã miss một số snippets code
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).
Converting Object to an Array
Converting Object to an Array
Await in a for loop
How to Await in a for loop
Ajax, call jQuery POST to node.js expressjs
Ajax, call jQuery POST to node.js expressjs
Filter Unique Values
Kiểu đối tượng Set đã được giới thiệu trong ES6 và cùng với ..., ‘spread’ operator, chúng ta có thể sử dụng nó để tạo một mảng mới chỉ với các giá trị duy nhất.