[英]What's wrong with these javascript
var Component = function (config) {
for (property in config) {
this[propety] = config[property]
}
}
var list = Array (
"Item 1",
"Item 2",
"Item 3");
var instance = Component(id: "XF-254", list: list);
沒用
var Component = function (config) {
for (var property in config) {
this[propety] = config[property]
}
}
var list = [
"Item 1",
"Item 2",
"Item 3"];
var instance = new Component({id: "XF-254", list: list});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.