Javascript 如何在表单中不显示null
我有一张表格。当前,当没有电子邮件的用户提交电子邮件时,它会在电子邮件字段字符串中显示,文本为Javascript 如何在表单中不显示null,javascript,reactjs,Javascript,Reactjs,我有一张表格。当前,当没有电子邮件的用户提交电子邮件时,它会在电子邮件字段字符串中显示,文本为null。如何使此字段为空。这是电子邮件字段的代码 patientEmail: currentPatient.email ? currentPatient.email : null PatientMail:currentPatient.email?currentPatient.email:“ 只需将null替换为空字符串 将null替换为”…使用或运算符作为默认值patientEmail:curren
null
。如何使此字段为空。这是电子邮件字段的代码
patientEmail: currentPatient.email ? currentPatient.email : null
PatientMail:currentPatient.email?currentPatient.email:“
只需将null替换为空字符串 将
null
替换为”
…使用或运算符作为默认值patientEmail:currentPatient.email | |?
;