救救孩子吧
寫四個(gè)按鈕,分別是創(chuàng)建(空數(shù)組) ,添加(添加一個(gè)人) ,修改(修改人的各個(gè)屬性),刪除數(shù)組功能。數(shù)組元素里面是對(duì)象,對(duì)象是{name:xx,sex:xx,age:xx}??
寫四個(gè)按鈕,分別是創(chuàng)建(空數(shù)組) ,添加(添加一個(gè)人) ,修改(修改人的各個(gè)屬性),刪除數(shù)組功能。數(shù)組元素里面是對(duì)象,對(duì)象是{name:xx,sex:xx,age:xx}??
2020-07-06
舉報(bào)
2020-07-20
不是哦,謝謝你
2020-07-07
<!DOCTYPE?html>
<html?lang="en">
<head>
????<meta?charset="UTF-8">
????<meta?name="viewport"?content="width=device-width,?initial-scale=1.0">
????<title>Document</title>
</head>
<body>
????<input?type="button"?value="創(chuàng)建空數(shù)組"?onclick="cre()"/>
????<input?type="button"?value="添加對(duì)象"?onclick="ins()"/>
????<input?type="button"?value="修改數(shù)組"?onclick="cha()"/>
????<input?type="button"?value="刪除數(shù)組"?onclick="del()"/>
<script?type="text/javascript">
????function?cre(){
????????var?a=new?Array();
????????console.log(a);
????}
????function?ins(){
????????a={name:"xx",sex:"xx",age:"xx"};
????????console.log(a);
????}
????function?cha(){
????????a.name="是這樣嗎?"
????????console.log(a);
????}
????function?del(){
????????delete?a;
????????console.log(a);
????}
</script>????
</body>
</html>