jquery-tmpl icon indicating copy to clipboard operation
jquery-tmpl copied to clipboard

Clean empty arrays

Open sindresorhus opened this issue 14 years ago • 2 comments

{{if}} should return false on empty arrays and arrays with empty strings.

sindresorhus avatar Aug 17 '11 09:08 sindresorhus

This isn't how javascript evaluates them. Boolean({}) === true Boolean([])=== true You can always do

{{if array.length }}

{{/if}

Or just use a {{each array}} statement.

As for the second part, I'm not sure what you're getting at or why you'd want it.

reconbot avatar Oct 04 '11 19:10 reconbot

Thanks for taking the time to submit this issue. Just wanted to let you know this plugin is no longer being actively developed or maintained by the jQuery team. See README for more info.

rdworth avatar Oct 08 '11 06:10 rdworth