Cayle Cayle - 3 months ago 15
Javascript Question

What do these type values in brackets inside a js object mean?

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']
}
}


I can't find any information on what the
[String: 'Gump;Forrest;;;']
means, how do I just access the value itself? Whenever I
console.log
it in node, I get

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

Answer

After reading the fine manual, I found that the way to get the value of the 'FN' property is:

let fullName = card.get('fn').valueOf();