Skip to main content

JavaScript Question 154

Question 154 of 0JavaScript

What's the output?

Login Required

Please login to select answers and solve this question. You can view the question without logging in.

Code:
const createMember = ({ email, address = {}}) => {
	const validEmail = /.+\@.+\..+/.test(email)
	if (!validEmail) throw new Error("Valid email pls")
	return {
		email,
		address: address ? address : null
	}
}

const member = createMember({ email: "my@email.com" })
console.log(member)

Select the correct option: