函数
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}
}
函数
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
网友评论