As question, What is the difference when a integer, string and array pass as function parameter in javascript?
Below are my question:
<html>
<head>
<script>
var a = 0;
var b = new Array();
b.push(0);
function Add(num) {
num++;
}
function Add1(num) {
num[0]++;
}
Add(a);
Add1(b);
alert(a);
alert(b[0]);
</script>
</head>
<body></body>
</html>
And it ended up provide two different value, why? The first result 0 and the second one is 1