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

try/catch es10

An update for developer convience allows the use of try/catch without an explicit e Error reference in the catch call.

encode/decode base64 with JS

Encoding to base64 is done with the btoa command

How to reverse an Array?

Reversing an array in JS is really simple with the standard array method. Like below

Getting the last element of a split string array

Getting the last element of a split string array

10 mẹo sử dụng array và object trong javascript

10 mẹo sử dụng array và object trong javascript