kiểm tra email trong javascript

tipjs,funciton

kiểm tra email trong javascript

const checkEmail = data => {
  const reg = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/g
  if (reg.test(data)) return true
}

Có thể bạn đã miss một số snippets code

encode/decode base64 with JS

Encoding to base64 is done with the btoa command

Async await in javascript

Async await in javascript

nullish coalescing javascript

nullish coalescing javascript

Promise + gì

promise + gì

Spread Operator for Objects

Using the spread operator during an Object declaration will assign the properties of the referenced Object to the new Object.