aaaa
This commit is contained in:
48
teaching/wanzhaoyi/js/duixiang.htm
Normal file
48
teaching/wanzhaoyi/js/duixiang.htm
Normal file
@@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<script>
|
||||
// 对象
|
||||
var obj={
|
||||
name:"刘亦菲",
|
||||
age:28,
|
||||
sex:"女",
|
||||
hobby:["看电影","听音乐","做美食"],
|
||||
waimao:"长头发大眼睛小嘴巴",
|
||||
zuofan:function(){
|
||||
console.log("我在做饭")
|
||||
},
|
||||
shuawan:function(){
|
||||
console.log("我在刷碗")
|
||||
},
|
||||
xuexi:function(){
|
||||
console.log("我在学习")
|
||||
}
|
||||
}
|
||||
|
||||
// 属性:name age sex hobby waimao
|
||||
// 方法 zuofan shuawan xuexi
|
||||
|
||||
obj.kandianying=function(){
|
||||
console.log("看电影啦")
|
||||
}
|
||||
|
||||
console.log(obj)
|
||||
obj.name="杨幂"
|
||||
obj.shuawan=function(){
|
||||
console.log("你去刷碗")
|
||||
return 123
|
||||
}
|
||||
var t=obj.shuawan()
|
||||
console.log(t,9990)
|
||||
delete obj.xuexi
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user