I have a email validation fuction where i need to trim string value twice.
(val) => (val.trim() && emailReg.test(val.trim()))
Or
(val) => {
const value = val.trim();
return value &&emailReg.test(value)
}
which is more faster and meet coding standards.