[請益] function參數有需要再存一次嗎?
常看到有人寫函數會把參數的值用變數存起來,
請問這樣的寫法有什麼特別的用意還是為避免什麼程式陷阱嗎?
為何不要直接用para就好了?
function (para)
{
value = para
value = value + 1
....
}
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.136.100.204
※ 文章網址: https://www.ptt.cc/bbs/Programming/M.1497584653.A.27E.html
推
06/16 12:44, , 1F
06/16 12:44, 1F
推
06/16 12:55, , 2F
06/16 12:55, 2F
→
06/16 12:55, , 3F
06/16 12:55, 3F
→
06/16 12:55, , 4F
06/16 12:55, 4F
→
06/16 12:55, , 5F
06/16 12:55, 5F
→
06/16 13:50, , 6F
06/16 13:50, 6F
※ 編輯: ggirls (114.136.100.204), 06/16/2017 13:53:41
→
06/16 14:29, , 7F
06/16 14:29, 7F
推
06/16 14:34, , 8F
06/16 14:34, 8F
→
06/16 14:53, , 9F
06/16 14:53, 9F
推
06/16 15:27, , 10F
06/16 15:27, 10F
→
06/16 15:27, , 11F
06/16 15:27, 11F
→
06/16 15:28, , 12F
06/16 15:28, 12F
推
06/16 19:26, , 13F
06/16 19:26, 13F
→
06/16 19:26, , 14F
06/16 19:26, 14F
→
06/16 19:26, , 15F
06/16 19:26, 15F
推
06/16 21:27, , 16F
06/16 21:27, 16F
推
06/30 02:03, , 17F
06/30 02:03, 17F
→
06/30 02:04, , 18F
06/30 02:04, 18F
Programming 近期熱門文章
PTT數位生活區 即時熱門文章