[問題] loop object property

作者: washqwe (阿蹦)   2015-12-25 14:20:52
http://i.imgur.com/cJXBszv.jpg
上圖最後只為一個image附值
需改為thestatus[thename] = 'normal'才可, 請問原因是
作者: rexyeah (ccccccc)   2015-12-25 15:05:00
弄個迴圈總有個目的吧..看起來這個迴圈的目的是命名啊
作者: washqwe (阿蹦)   2015-12-25 15:40:00
這只是舉例,
作者: eight0 (欸XD)   2015-12-25 17:07:00
object.property <=> object["property"]
作者: washqwe (阿蹦)   2015-12-25 21:44:00
在這例不成立
作者: johnny94 (32767)   2015-12-27 22:28:00
你確定theName這個變數的值等於theName?
作者: washqwe (阿蹦)   2015-12-27 22:40:00
作者: eight0 (欸XD)   2015-12-28 02:30:00
theStatus.theName => theStatus["theName"]theStatus["theName"] 和 theStatus[theName] 的意義是不一樣的唷

Links booklink

Contact Us: admin [ a t ] ucptt.com