Tutorialsplane

Vue.js Array Find


JavaScript Find method is used to find the value in array based on test(provided as function). Here in this tutorial, we are going to explain how you can use this method in Vuejs. You can also use our online editor to edit and run the code online.


Vue.js Array Find Method Example

You can use find method in vue.js simply as below-

Example:

<div id="app">
	<p>item 1 = {{ item1 }}</p>
	<p>Result = {{ item2 }}</p>

	<button>Click Me</button>
</div>
  

Try it ยป

The find function will test the array value based on function checkNum and return the first matching value.

Output of above example-