Collection Helpers

Table of Contents

collection

Visit the: collection | unit tests

{isEmpty}

Inline, subexpression, or block helper that returns true (or the block) if the given collection is empty, or false (or the inverse block, if supplied) if the colleciton is not empty.

Params

  • collection Object
  • options Object
  • returns String

Example


{{#isEmpty array}}AAA{{else}}BBB{{/isEmpty}}



{{isEmpty array}}

{iterate}

Block helper that iterates over an array or object. If an array is given, .forEach is called, or if an object is given, .forOwn is called, otherwise the inverse block is returned.

Params

  • collection Object|Array: The collection to iterate over
  • options Object
  • returns String

Table of Contents