看板 [ Ruby ]
討論串[無用] .call()可省略call
共 6 篇文章
首頁
上一頁
1
2
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者AIGecko (壁虎貓耳控)時間11年前 (2014/06/12 12:26), 編輯資訊
0
0
1
內容預覽:
偶然忘了打函式只打了小括號. 發現.()等同.call(). ->(){print "hello, world"}.() #=>hello, world. ->(){print "hello, world"}.call() #=>hello, world. 不只是Proc. 其他物件只要有call這
(還有160個字)
首頁
上一頁
1
2
下一頁
尾頁