node.js - Jade code block format -


while defining code block in jade, not sure whether dash - in front of code required.

for example, see below code works (from http://naltatis.github.io/jade-syntax-docs/#if):

if name == "bob"   h1 hello bob else   h1 name #{name} 

this works:

- if (name == "bob")     h1 hello bob - else     h1 name #{name} 

in second if parentheses needed. prefer first, wanted make sure both correct. jade official docs shows in second form.

as can find on jade reference page in "conditionals" section, can use both says :

jade's first-class conditional syntax allows optional parenthesis, , may omit leading - otherwise it's identical, still regular javascript


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -