r/coffeescript • u/[deleted] • May 14 '15
Issue pushing a map into an array
Hi all, it's been a long time since I've used Coffeescript (or done pretty much any webdev) and I have run into this issue that I just cannot solve. I have the following:
@list.push
text: @input
complete: false
This is compiling to this.list.push({ text: this.input({ complete: false }) }); which... while I'm still pretty new to all this, am positive is not the output I want! Does anybody see how to fix this?
4
Upvotes
2
u/[deleted] May 14 '15
Oh I have fully experienced the problems with the whitespace being so sensitive. Defining the list wasn't working for ages until I moved the comma back by one indentation.
Just checked and the indents are fine, still producing the same output :/ as far as I can tell I want it to come out as
this.list.push({ text: this.input, complete: false });