This is an example of Coffeescript compiling the code below
$ ->
$("#debug").val "hey"
for i in [0..3]
m = new Message(5,5)
text = "<div>#{m.message[m.message_id]}</div>"
$("body").append(text)
which transforms into:
$(function() {
return $("#debug").val("hey");
});
for (i = 0; i <= 3; i++) {
m = new Message(5, 5);
text = "<div>" + m.message[t.message_id] + "</div>";
$("body").append(text);
}
The "for" loop is placed outside the jQuery load function. This formatting strange is causing confusion. What could be wrong with my indentation technique?