1const createMember = ({ email, address = {}}) => { 2 const validEmail = /.+\@.+\..+/.test(email) 3 if (!validEmail) throw new Error("Valid email pls") 4 5 return { 6 email, 7 address: address ? address : null 8 } 9} 10 11const member = createMember({ email: "my@email.com" }) 12console.log(member)
本题为“单选题”