ruby杂记

    技术2025-09-04  17

    1:ruby中的  * 代表可变形参   和  乘   

    2:lambada   block   proc= Proc.new      proc就像一段代码  加入return语句的话会立即执行那个返回  二lambda会返回到自身 程序会自动运行

    3:hash

          hash= {1 => 3, "2" => 2 ,  3 = > 3}

         hash["2"]  hash[1]

     

    最新回复(0)