Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pug/Jade conditional AND/&& statement

I cannot seem to find detailed documentation on conditionals for Pug/Jade contemplating language to use && in a if statement.

I am try to achieve this:

if(true && string == 'saved'){

}

I have also tried using a nested if for those but it does not seem to work either:

if entryopen
  if !submitted
    button

Any help will be greatly appreciated!

like image 218
Stefan Zeuch Avatar asked Oct 07 '16 08:10

Stefan Zeuch


1 Answers

Should be

if entryopen && !submitted
  button

You can change code in this examples. And test it for yourself.

https://naltatis.github.io/jade-syntax-docs/#if

https://pugjs.org/language/conditionals.html

like image 57
Sardorbek Imomaliev Avatar answered Sep 21 '22 14:09

Sardorbek Imomaliev