有人可以告诉我如何让发送函数从下一个代码中读取电子邮件对象吗?
var email = {
to: 'google@gmail.com',
subject: 'new email',
text: 'helloWorld'
}
function send() {
var sendMe = new email();
console.log(sendMe.subject);
}
send();
我收到此错误我还尝试将电子邮件声明如下:
var email = new object();
它没有用
Uncaught TypeError: object is not a function