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
Object.keys và Object.getOwnPropertyNames
Object.keys và Object.getOwnPropertyNames
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.
Đếm số phần tử trong mảng JavaScript
Đếm số lần xuất hiện của các phần tử trong mảng JavaScript
Sự khác biệt giữa substr và substring
Sự khác biệt giữa substr() và substring() chức năng trong JS là gì?
Getting the last element of a split string array
Getting the last element of a split string array