obaa
Version:
Observe any object's any change.
37 lines (24 loc) • 477 B
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>obaa test</title>
<script src="util.js"></script>
<script src="../index.js"></script>
</head>
<body>
<script>
var arr = []
obaa(arr,function(a,b,c,d){
console.log(a,c,d)
})
arr.push('11')
var obj = {arr:[1],d: 1,c:{d:3,e:[]}}
obaa(obj,function(a,b,c,d){
console.log(a,c,d)
})
obj.arr.push('11')
obj.arr.push('22')
obj.c.e.push(4)
</script>
</body>
</html>