Tutorialsplane

Vue.js find min max element of Array


We can use JavaScript in-built math function to get the min and max value in an Array. You can use the same functions to get the min and max value from an array in vuejs.


Vue.js find min max element of Array JavaScript | VueJS Example

You cna get min and max value from an array in VueJS simply as below-

Example:

<div id="app">
	<p>Array = {{ item }}</p>	
	<p>Min Val = {{minVal}}</p>
	<p>Max Val = {{maxVal}}</p>
	<button>Click Me</button>
</div>
    

Try it ยป

Output of above example-