複雑な構造のオブジェクトから、Big5のnameに対応する日本語名、知的好奇心、誠実生、外交性、協調性、感情起伏の文字列と、それに対応するpercentileの計10このデータを取得したいのですが、うまくいきません。
javascript
1var big5s = { 2 personality : [ 3 { 4 "trait_id": "big5_openness", 5 "name": "知的好奇心", 6 "category": "personality", 7 "percentile": 0.8479480994964365, 8 "significant": true, 9 "children": [ 10 { 11 "trait_id": "facet_adventurousness", 12 "name": "大胆性", 13 "category": "personality", 14 "percentile": 0.7360829044915548, 15 "significant": true 16 }, 17 { 18 "trait_id": "facet_artistic_interests", 19 "name": "芸術的関心度", 20 "category": "personality", 21 "percentile": 0.4201330922838075, 22 "significant": true 23 }, 24 { 25 "trait_id": "facet_emotionality", 26 "name": "情動性", 27 "category": "personality", 28 "percentile": 0.11549813941234521, 29 "significant": true 30 }, 31 { 32 "trait_id": "facet_imagination", 33 "name": "想像力", 34 "category": "personality", 35 "percentile": 0.5857506181407868, 36 "significant": true 37 }, 38 { 39 "trait_id": "facet_intellect", 40 "name": "思考力", 41 "category": "personality", 42 "percentile": 0.8961197587759683, 43 "significant": true 44 }, 45 { 46 "trait_id": "facet_liberalism", 47 "name": "現状打破", 48 "category": "personality", 49 "percentile": 0.47288657009870294, 50 "significant": true 51 } 52 ] 53 }, 54 { 55 "trait_id": "big5_conscientiousness", 56 "name": "誠実性", 57 "category": "personality", 58 "percentile": 0.7950624883215796, 59 "significant": true, 60 "children": [ 61 { 62 "trait_id": "facet_achievement_striving", 63 "name": "達成努力", 64 "category": "personality", 65 "percentile": 0.9780480803300395, 66 "significant": true 67 }, 68 { 69 "trait_id": "facet_cautiousness", 70 "name": "注意深さ", 71 "category": "personality", 72 "percentile": 0.07647674907063756, 73 "significant": true 74 }, 75 { 76 "trait_id": "facet_dutifulness", 77 "name": "忠実さ", 78 "category": "personality", 79 "percentile": 0.43466079858994106, 80 "significant": true 81 }, 82 { 83 "trait_id": "facet_orderliness", 84 "name": "秩序性", 85 "category": "personality", 86 "percentile": 0.993883247866296, 87 "significant": true 88 }, 89 { 90 "trait_id": "facet_self_discipline", 91 "name": "自制力", 92 "category": "personality", 93 "percentile": 0.9842567772649841, 94 "significant": true 95 }, 96 { 97 "trait_id": "facet_self_efficacy", 98 "name": "自己効力感", 99 "category": "personality", 100 "percentile": 0.9942410230742221, 101 "significant": true 102 } 103 ] 104 }, 105 { 106 "trait_id": "big5_extraversion", 107 "name": "外向性", 108 "category": "personality", 109 "percentile": 0.9792137936278467, 110 "significant": true, 111 "children": [ 112 { 113 "trait_id": "facet_activity_level", 114 "name": "活発度", 115 "category": "personality", 116 "percentile": 0.9998766501977376, 117 "significant": true 118 }, 119 { 120 "trait_id": "facet_assertiveness", 121 "name": "自己主張", 122 "category": "personality", 123 "percentile": 0.8138904562348104, 124 "significant": true 125 }, 126 { 127 "trait_id": "facet_cheerfulness", 128 "name": "明朗性", 129 "category": "personality", 130 "percentile": 0.9940439440943019, 131 "significant": true 132 }, 133 { 134 "trait_id": "facet_excitement_seeking", 135 "name": "刺激希求性", 136 "category": "personality", 137 "percentile": 0.9997055509426556, 138 "significant": true 139 }, 140 { 141 "trait_id": "facet_friendliness", 142 "name": "友好性", 143 "category": "personality", 144 "percentile": 0.9991735484500139, 145 "significant": true 146 }, 147 { 148 "trait_id": "facet_gregariousness", 149 "name": "社交性", 150 "category": "personality", 151 "percentile": 0.9602369016231298, 152 "significant": true 153 } 154 ] 155 }, 156 { 157 "trait_id": "big5_agreeableness", 158 "name": "協調性", 159 "category": "personality", 160 "percentile": 0.6835293098300844, 161 "significant": true, 162 "children": [ 163 { 164 "trait_id": "facet_altruism", 165 "name": "利他主義", 166 "category": "personality", 167 "percentile": 0.6917487512446171, 168 "significant": true 169 }, 170 { 171 "trait_id": "facet_cooperation", 172 "name": "協働性", 173 "category": "personality", 174 "percentile": 0.14485396026375474, 175 "significant": true 176 }, 177 { 178 "trait_id": "facet_modesty", 179 "name": "謙虚さ", 180 "category": "personality", 181 "percentile": 8.3510264814457e-9, 182 "significant": true 183 }, 184 { 185 "trait_id": "facet_morality", 186 "name": "強硬さ", 187 "category": "personality", 188 "percentile": 0.13482488590642866, 189 "significant": true 190 }, 191 { 192 "trait_id": "facet_sympathy", 193 "name": "共感度", 194 "category": "personality", 195 "percentile": 0.5225705647683129, 196 "significant": true 197 }, 198 { 199 "trait_id": "facet_trust", 200 "name": "信用度", 201 "category": "personality", 202 "percentile": 0.9999762525748865, 203 "significant": true 204 } 205 ] 206 }, 207 { 208 "trait_id": "big5_neuroticism", 209 "name": "感情起伏", 210 "category": "personality", 211 "percentile": 0.3443811655423583, 212 "significant": true, 213 "children": [ 214 { 215 "trait_id": "facet_anger", 216 "name": "激情的", 217 "category": "personality", 218 "percentile": 0.01859478356930322, 219 "significant": true 220 }, 221 { 222 "trait_id": "facet_anxiety", 223 "name": "心配性", 224 "category": "personality", 225 "percentile": 0.29713035531870124, 226 "significant": true 227 }, 228 { 229 "trait_id": "facet_depression", 230 "name": "悲観的", 231 "category": "personality", 232 "percentile": 0.07334386218074274, 233 "significant": true 234 }, 235 { 236 "trait_id": "facet_immoderation", 237 "name": "利己的", 238 "category": "personality", 239 "percentile": 0.22340954892982745, 240 "significant": true 241 }, 242 { 243 "trait_id": "facet_self_consciousness", 244 "name": "自意識過剰", 245 "category": "personality", 246 "percentile": 0.42125874329980123, 247 "significant": true 248 }, 249 { 250 "trait_id": "facet_vulnerability", 251 "name": "低ストレス耐性", 252 "category": "personality", 253 "percentile": 0.22731164582760738, 254 "significant": true 255 } 256 ] 257 } 258 ] 259 }
javascript
1 res.json(big5s.personality[0].name);
までは自分でやって、こうすると、最初の文字列生えられるのですが、ここからができないです。
基礎的とは思いますが、お知恵を拝借願えないでしょうか
回答1件
あなたの回答
tips
プレビュー