<!DOCTYPE html>
<html lang="en-US">
<body>
<p>In call by reference, any changes made to formal parameter (a, b) will affect the actual parameter (arr, obj)</p>
<p>Check your console. (Press F12)</p>
<script>
var x = document.getElementById("point");
var arr = [1, 2, 3];
var obj = {brand:"Honda", color:"Red"};
function myFunction(a, b){
a[2] = 6;
b.color = "green";
}
myFunction(arr, obj);
console.log("arr : "+ arr);
console.log("obj : " + JSON.stringify(obj))
</script> </body>
</html>