To add items in Nunjucks, use the .push() function. {% set arr = [1,2] %} {% set arr = (arr.push(3), arr) %} Final array: arr = [1,2,3] Unfortunately, I did not found any references in the official Nunjucks documentation for this useful functio...
Markdown supported Β· ββ΅ to post
Giulia Chiola
Manjunatha Kaliyur
TY. Found this after trying to accomplish this exact same feature. This is really useful.