Iterating objects with underscore.js
-
29-10-2019 - |
Pergunta
So, I am learning out backbone.js and are currently iterating over some models in a view with the below example. The first snippet works, when the other underscore.js-based one doesn't. Why?
// 1: Working
this.collection.each(function(model){ console.log(model.get("description")); });
// 2: Not working
_.each(this.collection, function(model){ console.log(model.get("description")); });
What am I doing wrong, as I can't see it by myself?
Nenhuma solução correta
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow