webveuje/teaching/wanzhaoyi/js/duixiang.htm
2021-06-03 10:52:41 +08:00

48 lines
1.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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>