Skip to content

Instantly share code, notes, and snippets.

@zwily
Created May 30, 2013 03:34
Show Gist options
  • Save zwily/5675579 to your computer and use it in GitHub Desktop.
Save zwily/5675579 to your computer and use it in GitHub Desktop.

programStations is an Ember.ArrayController

  console.log programStations.mapProperty('id')
  programStations.forEach (programStation, index) ->
    console.log "#{index}: #{programStation.get 'id'}

outputs:

-Ivme_qDpo-jLuDoDKWb,-Ivmeanfr5UpajT0w2ro,-IvmecErq7nPccMraauU,-IvmecF1BtqNxqXMc4qC,-Ivmfr2igN9vHLwkIGQT,-IvmehN0Guvy2j_-VA4J
0: -Ivme_qDpo-jLuDoDKWb
1: -Ivmeanfr5UpajT0w2ro
2: -IvmecErq7nPccMraauU
3: -IvmecF1BtqNxqXMc4qC
4: -Ivmfr2igN9vHLwkIGQT
5: -Ivmfr2igN9vHLwkIGQT

Compare the last item in the array vs the last thing logged in the forEach iteration. wtf :/

(Still haven't managed to get this down to a simple jsbin reduction.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment