Scala/Scala.jsで良かったこと ①代数的データ構造、構造的部分型などの強力な型 type Host = String | js.Array[String] sealed trait Color case class RGB(r:Int,g:Int,b:Int) extends Color case class RGBA(r:Int,g:Int,b:Int,a:Double) extends Color case class HSV(h:Double,s:Double,v:Double) extends Color type HasName = { def name(): String }