[
{
"font": {
"size": 9,
"name": "宋体",
"charset": 134
},
"text": "上海市普陀区宜川路"
},
{
"font": {
"size": 9,
"name": "Arial",
"charset": 134
},
"text": "310"
},
{
"font": {
"size": 9,
"name": "宋体",
"charset": 134
},
"text": "号"
},
{
"font": {
"size": 9,
"name": "Arial",
"charset": 134
},
"text": "2"
},
{
"font": {
"size": 9,
"name": "宋体",
"charset": 134
},
"text": "幢二层"
},
{
"font": {
"size": 9,
"name": "Arial",
"charset": 134
},
"text": "204"
},
{
"font": {
"size": 9,
"name": "宋体",
"charset": 134
},
"text": "室"
}
]
lst = [
{
"font": {
"size": 9,
"name": "宋体",
"charset": 134
},
"text": "上海市普陀区宜川路"
},
{
"font": {
"size": 9,
"name": "Arial",
"charset": 134
},
"text": "310"
},
{
"font": {
"size": 9,
"name": "宋体",
"charset": 134
},
"text": "号"
},
{
"font": {
"size": 9,
"name": "Arial",
"charset": 134
},
"text": "2"
},
{
"font": {
"size": 9,
"name": "宋体",
"charset": 134
},
"text": "幢二层"
},
{
"font": {
"size": 9,
"name": "Arial",
"charset": 134
},
"text": "204"
},
{
"font": {
"size": 9,
"name": "宋体",
"charset": 134
},
"text": "室"
}
]
str = '';
for(let i=0;i<lst.length;i++){
str = str+lst[i].text;
}
console.log(str);
// 一个reduce搞定
const res = arr.reduce((prev, curr) => {
return prev + curr.text
}, '')