美文网首页
dart语言

dart语言

作者: 阿克兰 | 来源:发表于2019-11-13 11:17 被阅读0次

函数

data(x,y){
    if(x>y){
      return x
  }else{
    return y
  }
}
// 等价于
data(x,y)=>(x>y)?x:y

函数类的概念

class Point(){
    var x,y;
   Point(this.x,this.y);
   scale(factor)=>new Ponit(){x*factor,y*factot\r}
}

相关文章

网友评论

      本文标题:dart语言

      本文链接:https://www.haomeiwen.com/subject/gqqhictx.html