Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/lara_template_deno/examples/conditionals.deno

renderer, compiler, transpiler, minifier, and template formatter for Deno
Latest
File
@code const number = 1; const auth = true; const name = "john"; const month = "january"@endcode
conditional "if"@if(number == 1){{ number }}@endif
conditional "if & else"@if(auth)is {{ auth }}@elseis {{ auth }}@endif
conditional "if & else if"@if(name == "john")my name is {{ name }}@elseif(name == "martha")my name is {{ name }}@endif
conditional "if, else if & else"@if(month == "january")the month is {{ month }}@elseif(month == "february")the month is {{ month }}@elsethe month is {{ month }}@endif
conditional ternary{{ number !== 5 ? true : false }}
conditional switch@switch(number) @case(1) is one @break @case(2) is two @break @default is any number@endswitch