<!DOCTYPE >
<html>
<head>
<title>Loop through an array using jQuery</title>
<script src="https://code.jquery.com/jquery-1.11.2.js"></script>
<script type="text/javascript">
$(document).ready(function () {
function myFunction( var a, var b) { //Without var, the function works fine!!!!!!
return a + b;
}
var m=0;
$('# iknow').click(function(){
m=m+1;
var k = myFunction('king', m);
alert(k);
});
});
</script>
</head>
<body>
<button id ="iknow"> I know</button>
</body>
</html>