一、
interface theObj {
title: string;
content: string;
point: string[];
[x: string]: any; //動態添加屬性
}
let newObj:theObj={}
二、
let newObj: { [k: string]: any } = {};
一、
interface theObj {
title: string;
content: string;
point: string[];
[x: string]: any; //動態添加屬性
}
let newObj:theObj={}
二、
let newObj: { [k: string]: any } = {};
表單提交數據 表單提交數據有集中方式,比如說下面的表單: <form class="container"> <div class="row"> <div class="col-25"><
簡單的說,字面量對象提供了一直非常方便構建新對象的方式,它的格式非常簡單且容易閱讀。是大多數前端程序員在構建對象時比較推崇的一種方式。 格式: var person = { name : "ziv",