Skip to main content
Version: 1.20 (unreleased)

Chapter 6

Zee took a short rest and continued walking to CamundaCon. 🇩🇪 On the road, he passed mountains, fields, and woods. ⛰️ 🌳 After a few days, he realized that he walked in cycles. 😵 Unsure about right way, he looks at the trail markers. 🟥 🔵 🔶

Can you help him to choose the right way to Berlin?

Expression

// use list operators and return the right route
routes

Context

A JSON document that is used to resolve variables in the expression.
{
  "routes": [
    {
      "route": "red",
      "stops": [
        "Cologne",
        "Frankfurt",
        "Nuremberg",
        "Munich"
      ]
    },
    {
      "route": "blue",
      "stops": [
        "Cologne",
        "Paderborn",
        "Hanover",
        "Berlin"
      ]
    },
    {
      "route": "yellow",
      "stops": [
        "Cologne",
        "Münster",
        "Bremen",
        "Hamburg"
      ]
    }
  ]
}


Result

<click 'Evaluate' to see the result of the expression>

Warnings

<none>
Solution
Zee follows the blue route and reaches CamundaCon just-in-time. He is happy to be there and meet the community.

Expression
routes["Berlin" in stops][1].route