console
let _this = null
var app = new Vue({
el: '#app',
data: {
filter: [],
entries: [],
insertForm: {
marketName: null,
marketValue: 0
}
},
created() {
_this = this
_this.initMethods()
},
methods: {
initMethods() {
const arr = ['a', 'b', 'c', 'd']
_this.filter = arr.filter(v => (v === 'a' || v === 'b'))
var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.entries();
console.log(fruits.entries())
},
}
})
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>文档标题</title>
</head>
<body>
<div id="app">
<h1>js</h1>
<p>数组</p>
<p>// 筛选</p>
<span>filter:{{filter}}</span>
<p>// 迭代</p>
<span>entries:{{entries}}</span>
</div>
</body>
</html>