js对象中括号中的这些类型值是什么意思?

时间:2016-09-06 16:46:30

标签: javascript node.js

vCard {
  version: '4.0',
  data: {
    version: [String: '4.0'],
    n: [String: 'Gump;Forrest;;;'],
    fn: [String: 'Forrest Gump'],
    org: [String: 'Bubba Gump Shrimp Co.'],
    title: [String: 'Shrimp Man'],
    photo: { [String: 'http://www.example.com/dir_photos/my_photo.gif'] mediatype: 'image/gif' },
    tel: [
      { [String: 'tel:+11115551212'] type: [ 'work', 'voice' ], value: 'uri' },
      { [String: 'tel:+14045551212'] type: [ 'home', 'voice' ], value: 'uri' }
    ],
    adr: [
      { [String: ';;100 Waters Edge;Baytown;LA;30314;United States of America']
        type: 'work',
        label: '"100 Waters Edge\\nBaytown, LA 30314\\nUnited States of America"' },
      { [String: ';;42 Plantation St.;Baytown;LA;30314;United States of America']
        type: 'home',
        label: '"42 Plantation St.\\nBaytown, LA 30314\\nUnited States ofAmerica"' }
    ],
    email: [String: 'forrestgump@example.com'],
    rev: [String: '20080424T195243Z']
  }
}

我无法找到有关[String: 'Gump;Forrest;;;']含义的任何信息,我如何只访问该值?每当我在节点中console.log时,我就会得到

[String: 'Forrest Gump (Full Name)']

1 个答案:

答案 0 :(得分:4)

阅读the fine manual后,我发现获取'FN'属性值的方法是:

if(mFragment == null)
{ 
    mFragment = new MyFragment();
    return mFragment;
}