Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make '??'-operator return the actual array instead of array length #653

Merged
merged 2 commits into from
Nov 11, 2019
Merged

Make '??'-operator return the actual array instead of array length #653

merged 2 commits into from
Nov 11, 2019

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