I'm new to Typescript and coming from a background mostly in scala. I'm wondering if there is a way to sort by specific values in Typescript, similar to how I would do it in scala:
Seq("bbb", "foo", "bar", "aaa", "hello", "world", "ccc").sortBy { word =>
word match {
case "hello" => 0
case "bar" => 1
case "foo" => 2
case "world" => 3
case _ => 4
}
} // val res1: Seq[String] = List(hello, bar, foo, world, bbb, aaa, ccc)