【发布时间】:2017-11-04 08:58:18
【问题描述】:
我正在看教程,我尝试运行以下代码,但没有运行。
var person = {
'address': {
'street': 'Rose Road',
'city': 'somewhere',
'state': 'CA'
},
'isfromState': fucntion(state) {
return (this.address.state === state);
}
}
console.log(person.isfromState('blah'));
相反,它给了我这个错误Exception: SyntaxError: missing } after property list,我找不到错误。
【问题讨论】:
-
fucntion应该是function
标签: javascript compiler-errors syntax-error