Find Array Min and Max value in JavaScript
home
Run
screen_rotation
fullscreen
cloud_download
navigate_next
<html> <head> <title>Javascript Demo</title> <script type='text/javascript'> function getMinVal(array){ return Math.min.apply(Math,array); } function test(){ var a = [9, 4, 5, 6]; var res = getMinVal(a); alert(res); } </script> </head> <body> <a href="javascript:void(0)" onclick=" test()">Get Minimum </a> <p id='result'></p> </body> </html>
<html> <head> <title>Javascript Demo</title> <script type='text/javascript'> function getMinVal(array){ return Math.min.apply(Math,array); } function test(){ var a = [9, 4, 5, 6]; var res = getMinVal(a); alert(res); } </script> </head> <body> <a href="javascript:void(0)" onclick=" test()">Get Minimum </a> <p id='result'></p> </body> </html>
Copyrights@tutorialsplane.com