Get object value by property reference not working on iOS

故事扮演 提交于 2019-12-25 15:16:53

问题


This is my object:

var charsObj = {"drive":{"status":"inprogress","data":"some data","history":"the text of my history"}}


function getNote(x) { 
   if ( x in charsObj) { 
     console.log(charsObj[x])
    } else { 
      console.log('nothing', charsObj[x])
    }
}

if I call getNote('drive') it returns my object value as expected EXCEPT iOS returns 'nothing', undefined.

How do I get this to work on iOS?

来源:https://stackoverflow.com/questions/26024488/get-object-value-by-property-reference-not-working-on-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!