Pug is being rendered via express
The following two blocks of pug code give different results:
each page in paginatorPages
li(class="page-item" class={"d-none d-sm-flex": page < currentPage - 1 || page > currentPage + 0})
each page in paginatorPages
li(class="page-item" class={"d-none d-sm-flex": page < currentPage - 1 || page > currentPage})
The only difference is the + 0 near the end of the second line. My actual use case here is that I would like to check page > currentPage + 1, but through experimentation, I discovered that any addition operation in the back half of the second equation results in strange behavior. Resultant HTML is as follows where currentPage == 3 and paginatorPages == [1, 2, 3, 4, 5]:
Pug Version: 3.0.2
Node Version: 16.15.0
Pug is being rendered via express The following two blocks of pug code give different results:
The only difference is the
+ 0
near the end of the second line. My actual use case here is that I would like to checkpage > currentPage + 1
, but through experimentation, I discovered that any addition operation in the back half of the second equation results in strange behavior. Resultant HTML is as follows wherecurrentPage == 3
andpaginatorPages == [1, 2, 3, 4, 5]
: