假设我想用JS创建一个对象,然后从里面调用一个函数,我读到这行代码应该可以工作,但它没有。
var college = {name: “College Of West Anglia”, pupils:1200, location1: “Kings Lynn”, location2:”Wisbech”, location3:”Cambridge”, fulladdress: function(){
return this.name + " " + this.location1}};
它出现了一个"令牌错误"。