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

truthy docs? #1268

Open
pdehaan opened this issue Feb 22, 2020 · 1 comment
Open

truthy docs? #1268

pdehaan opened this issue Feb 22, 2020 · 1 comment

Comments

@pdehaan
Copy link
Contributor

pdehaan commented Feb 22, 2020

liquidjs has this really handy chart of what is truthy or falsy, but I can't seem to find if Nunjucks has some similar reference: https://github.com/harttle/liquidjs/wiki/Truthy-and-Falsy

Truthy_and_Falsy_·_harttle_liquidjs_Wiki

I tried hacking together some tests to see the differences between liquidjs and nunjucks behavior but I think the only difference was liquidjs considers an empty string truthy, but nunjucks considers it falsy (which I think is better). 🤷‍♂

@ogonkov
Copy link
Contributor

ogonkov commented Mar 29, 2020

Nunjucks follow JS "trythy" logic of types coercion.

But this is likely would change after #1059 (see listed issues).

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

No branches or pull requests

2 participants