Case Statements

Use case when you want to choose between several possible values.

case status
  when "pending"
    p Your order is being processed.
  when "shipped"
    p Your order is on its way.
  when "complete"
    p Your order has arrived.
  default
    p Status unavailable.

Jade’s case syntax corresponds closely to JavaScript’s switch statement while fitting naturally into an indented template. (source)

Fall-through

Multiple when branches can share the same output when appropriate.

case role
  when "admin"
  when "owner"
    p Full access
  default
    p Standard access

Jade Language © 2026 | About Us | Privacy Policy