Vue
by Joshua Mallorca
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.min.js"></script>
<div id="app">
<button @click="testing">
return
</button>
{{ returnType }}
</div>
Vue
new Vue({
el: "#app",
data: {
todos: [
{ text: "Learn JavaScript", done: false },
//{ text: "Build something awesome", done: true }
],
returnType: "return goes here"
},
methods: {
testing (){
var a = _.find(this.todos, { done: true });
if(a === undefined) this.returnType = "undefined";
else
}
}
})