Just short note to my self. If getElementById doesn't work, most probably I forgot window.onload, because if page is not loaded yet, and javascript is executed, then my element with ID will not exist. So, html part looks like:


<!DOCTYPE html>

		<script type="text/javascript" src="/arrayAssignment.js"></script>
		Variable <strong>A</strong>: <span id='varA'></span>
		<strong>var b = a</strong>: <span id='b=a'></span>
		Variable <strong>A</strong>: <span id='bSplice'></span>


and javascript part should lok something like:

window.onload = function() {
	var a = [];
	var b = [];
	a = [1, 2, 3, 4]
	b = a;
	document.getElementById("varA").innerHTML = a;
	document.getElementById("b=a").innerHTML = b;
	document.getElementById("bSplice").innerHTML = a;

This is just short note to myself since I always forget onLoad part :)