const newObject = [ {% for item in module.field_group %} { "col_name": "{{ item.col_name }}", "input_type": "{{ item.input_type }}" }{% if not loop.last %},{% endif %} {% endfor %} ]; console.log("?? newObject", newObject);
Please check the console for the result, and see how object newObject works on JavaScript
newObject