{"issue":{"title":"Access array elements","user":{"login":"ThorbenJ","id":1284751,"url":"https://api.github.com/users/ThorbenJ","gravatar_id":"9880f5662938e3324f6ce81eea44e6b7","avatar_url":"https://secure.gravatar.com/avatar/9880f5662938e3324f6ce81eea44e6b7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"created_at":"2011-12-25T13:48:14Z","milestone":null,"state":"open","updated_at":"2011-12-25T13:48:14Z","labels":[],"id":2655152,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"closed_at":null,"html_url":"https://github.com/BorisMoore/jsrender/issues/56","body":"Hi,\r\n\r\nI don't want to iterate over an array, i would like to be able to access specific array elements, but I can't work out how..\r\n\r\nCan you help?\r\n\r\ne.g.\r\n\r\n{\r\n  columns: [ 'letter', 'number', 'year' ],\r\n  data: [\r\n    [ 'A', 1, 2001 ],\r\n    [ 'B', 2, 2002 ],\r\n    [ 'C', 3, 2003 ],\r\n}\r\n\r\n<UL>\r\n{{#each data}}\r\n<LI><UL>\r\n    <LI>Letter: {{=$data[0]}}, Number: {{=$data[1]}}, Year: {{=$data[2]}}\r\n  <UL>\r\n{{/each}}\r\n\r\nHere I do almost with every element, but in my actual code values are treated very differently.\r\n\r\nThe only way I can see, at the moment, is to have another inner each, with lots of: if itemNumber == 0, etc\r\nwhich would be horrible.\r\n\r\nRegrads,\r\n\r\nThorben","number":56,"url":"https://api.github.com/repos/BorisMoore/jsrender/issues/56","comments":0,"assignee":null},"action":"opened"}