Here the output for a and b is same but in case of slice() we didn't pass any parameter so the output for a, b, and c must be same. So why is the output of c different from a and b here?
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p id="1"></p>
<p id="2"></p>
<p id="3"></p>
<p id="4"></p>
<script>
var a=["a","b","c"];
var b=a;
var c=a.slice();
a.push("date");
document.getElementById("1").innerHTML=a;
document.getElementById("2").innerHTML=b;
document.getElementById("3").innerHTML=c;
document.getElementById("4").innerHTML=a;
</script>
</body>
</html>
Output:
a,b,c,date
a,b,c,date
a,b,c
a,b,c,date