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
encode/decode base64 with JS
Encoding to base64 is done with the btoa command
Remove item in array javascript es6
Những bạn nào mà đã sử dụng ES6 một thời gian rồi thì có thể sử dụng method array.filter()
Converting Object to an Array
Converting Object to an Array
Detect when your site is visible to users
Detect when your site is visible to users