JavaScript: Experimental code, as JavaScript confusing