Case

Other topics

Case

- var friends = 10
case friends
  when 0
    p you have no friends
  when 1
    p you have a friend
  default
    p you have #{friends} friends

Result is:

<p>you have 10 friends</p>

Contributors

Topic Id: 4012

Example Ids: 14010

This site is not affiliated with any of the contributors.