Ad
const parse = (value = '') => {
  if (/^[^@]+@[^@]+\.[a-zA-Z]{2,}$/.test(value)) {
    return true
  } else {
    return false
  }
}
function replaceAllInTextWith(text, search, textReplace) {
  return text.split(search).join(textReplace)
}

Validate a property in object

function validateProperty(objectForValidate, specificProperty) {
  if(objectForValidate[specificProperty]){
    return true;
  } else{
    return false;
  }
}

Validate a porperty in object

function validateProperty(objectForValidate, specificProperty) {
  if(objectForValidate[specificProperty]){
    return true;
  } else{
    return false;
  }
}