Skip to content

Conversation

@diegomorales
Copy link

@diegomorales diegomorales commented Jul 17, 2019

The '??'-operator is very handy for setting default values. Like for example:

{% set list = list ?? [] %}

This works in PHP Twig. And it should of course work in twig.js too :)

@RobLoach
Copy link
Collaborator

Thank you! Going to merge this one. 👍

@RobLoach RobLoach merged commit 3068b0d into twigjs:master Nov 11, 2019
RobLoach added a commit that referenced this pull request Nov 11, 2019
@diegomorales diegomorales deleted the null-coalesc-array branch November 11, 2019 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants