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.

Spread Operator for Objects

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

Lấy tháng hiện tại trong javascript

Lấy tháng hiện tại trong javascript

How to reverse an Array?

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

using javascript callback style error handling