Monday, 4 August 2014

Quick quiz: checking your expectations

G'day:
This is a super quick one. What would you expect this code to output:

//each.cfm
a = ["a"];
a[3] = "c";

a.each(function(v,i,a){
    writeOutput("value: #v#<br>");
});

This is not a trick question, and I'm not looking for "clever" answers. I just want to know - all things being equal - what output you'd expect here.

What info I'm after here is just which way people's expectations tend, not who's right or wrong.

Answers on a postcardin a comment, pls.

--
Adam