либо создать массив и через foreach перебирать все поступившие данные, что будет быстрее?
getPeople().subscribe(data => console.log(data))
[
{
"general": [
{
"firstName": "Liana",
"lastName": "Crooks",
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/kevinoh/128.jpg"
}
],
"job": [
{
"company": "Ledner, Johnson and Predovic",
"title": "Investor Functionality Coordinator"
}
],
"contact": [
{
"email": "Gerry_Hackett77@gmail.com",
"phone": "(895) 984-0132"
}
],
"address": [
{
"street": "1520 Zemlak Cove",
"city": "New Devon",
"zipCode": "42586-7898",
"country": "Guinea-Bissau"
}
]
},
{
"general": [
{
"firstName": "Deontae",
"lastName": "Dare",
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/andysolomon/128.jpg"
}
],
"job": [
{
"company": "D'Amore, Dicki and Borer",
"title": "International Applications Consultant"
}
],
"contact": [
{
"email": "Kellie.Marvin38@yahoo.com",
"phone": "1-615-843-3426 x600"
}
],
"address": [
{
"street": "65901 Glover Terrace",
"city": "Alden ton",
"zipCode": "57744-4248",
"country": "Kenya"
}
]
}
]
{
"a": {
"general": [
{
"firstName": "Liana",
"lastName": "Crooks",
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/kevinoh/128.jpg"
}
],
"job": [
{
"company": "Ledner, Johnson and Predovic",
"title": "Investor Functionality Coordinator"
}
],
"contact": [
{
"email": "Gerry_Hackett77@gmail.com",
"phone": "(895) 984-0132"
}
],
"address": [
{
"street": "1520 Zemlak Cove",
"city": "New Devon",
"zipCode": "42586-7898",
"country": "Guinea-Bissau"
}
]
},
"b": {
"general": [
{
"firstName": "Deontae",
"lastName": "Dare",
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/andysolomon/128.jpg"
}
],
"job": [
{
"company": "D'Amore, Dicki and Borer",
"title": "International Applications Consultant"
}
],
"contact": [
{
"email": "Kellie.Marvin38@yahoo.com",
"phone": "1-615-843-3426 x600"
}
],
"address": [
{
"street": "65901 Glover Terrace",
"city": "Alden ton",
"zipCode": "57744-4248",
"country": "Kenya"
}
]
}
}
{
"data": [
{
"general": {
"firstName": "Liana",
"lastName": "Crooks",
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/kevinoh/128.jpg"
},
"job": {
"company": "Ledner, Johnson and Predovic",
"title": "Investor Functionality Coordinator"
},
"contact": {
"email": "Gerry_Hackett77@gmail.com",
"phone": "(895) 984-0132"
},
"address": {
"street": "1520 Zemlak Cove",
"city": "New Devon",
"zipCode": "42586-7898",
"country": "Guinea-Bissau"
}
},
{
"general": {
"firstName": "Deontae",
"lastName": "Dare",
"avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/andysolomon/128.jpg"
},
"job": {
"company": "D'Amore, Dicki and Borer",
"title": "International Applications Consultant"
},
"contact": {
"email": "Kellie.Marvin38@yahoo.com",
"phone": "1-615-843-3426 x600"
},
"address": {
"street": "65901 Glover Terrace",
"city": "Alden ton",
"zipCode": "57744-4248",
"country": "Kenya"
}
}
]
}
var a = [
{
"Acmeindustries": {
"domain": [
"com Commercial organization",
"net Network",
"org Organization"
],
"ipaddress": [
"12.12.162.0",
"165.12.21.170"
]
}
},
{
"Unitedindustrial": {
"domain": [
"net Commercial ",
"net Network",
"org Organization"
],
"ipaddress": [
"12.12.162.0",
"165.12.21.170"
]
}
}
]
console.log(a) // [{...}, {...}]
localStorage.setItem('dt', JSON.stringify(a))
var b = JSON.parse(localStorage.getItem('dt'))
console.log(b) // [{...}, {...}]
var list = [{
category: 'Посуда',
image: 'http://teadrinkers.org/assets/images/products/417/c2cee981a39099c7fa00c9c7797dfe7afae168fb.jpg',
title: 'Заголовок',
price: '10',
year: '2015',
country: 'Китай',
gram: false
},
{
category: 'Посуда',
image: 'http://teadrinkers.org/assets/images/products/354/42993ea70df676dfc302af7073b2503f581c2132.jpg',
title: 'Чашка глина (1)',
price: '500',
year: '2017',
country: 'Япония',
gram: false
},
{
category: 'Улун',
image: 'http://teadrinkers.org/assets/images/products/305/8386f5419680011666732dcf3a385a5c197d3ab9.png',
title: 'ГАБА улун полусферической скрутки',
price: '20',
year: '2002',
country: 'Китай',
gram: true
},
{
category: 'Красный чай',
image: 'http://teadrinkers.org/assets/images/products/433/34abe5f187227d79e0e8f7bb60711817072066f5.jpg',
title: 'Чжэн Хэ Сяо Чжун',
price: '22',
year: '2013',
country: 'Китай',
gram: true
}]
var data = 'Красный чай, Улун' //ваши данные из локалсторадж
var order = data.split(", ") //те же данные, но в массиве
var res = [] //сюда выводим
order.forEach(item => res.push(list.filter(l => l.category == item))) //данные по списку
res.push(list.filter(l => order.indexOf(l.category) == -1)) //все остальное
res = [].concat.apply([], res); //склеиваем
не работает из-за add, пишет что нет такого метода или он невалиден
dataLayer.ecommerce.add.products.push({name:00, price:00})
function drawLine(section){
//здесь код, как вы берете эту секцию и рисуете
}
series:
[
{
type: 'line',
name: 'temp to press',
data: data
},
{
type: 'line',
name: 'temp to press1',
data: data
}
]
series.forEach( function(item){ drawLine(item) } )
res.redirect(301, 'http://example.com');