Skip to content

Instantly share code, notes, and snippets.

@eroncardoso88
Last active May 24, 2019 13:11
Show Gist options
  • Save eroncardoso88/47d77d74fcbdebd0aa95117dd3b0022a to your computer and use it in GitHub Desktop.
Save eroncardoso88/47d77d74fcbdebd0aa95117dd3b0022a to your computer and use it in GitHub Desktop.
Json data to be accessed
const apiCallArr = [
{"coord":{"lon":-43.21,"lat":-22.9},
"sys":{"type":1,"id":8429,"message":0.0055,"country":"BR","sunrise":1558516909,"sunset":1558556248},
"weather":[{"id":721,"main":"Haze","description":"haze","icon":"50d"}],
"main":{"temp":28.98,"pressure":1013,"humidity":70,"temp_min":28.89,"temp_max":29},
"visibility":5000,
"wind":{"speed":1.5,"deg":40},
"clouds":{"all":20},"dt":1558544075,
"id":3451190,
"name":"Rio de Janeiro"},
{"coord":{"lon":-46.64,"lat":-23.55},
"sys":{"type":1,"id":8394,"message":0.0056,"country":"BR","sunrise":1558517800,"sunset":1558557003},
"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],
"main":{"temp":25.95,"pressure":1017,"humidity":44,"temp_min":25,"temp_max":29},
"visibility":10000,
"wind":{"speed":3.1,"deg":290},
"clouds":{"all":0},"dt":1558544075,
"id":3448439,
"name":"Sao Paulo"},
{"coord":{"lon":-47.93,"lat":-15.78},
"sys":{"type":1,"id":8336,"message":0.006,"country":"BR","sunrise":1558517334,"sunset":1558558088},
"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],
"main":{"temp":27.6,"pressure":1020,"humidity":51,"temp_min":27.22,"temp_max":28},
"visibility":10000,
"wind":{"speed":4.6,"deg":90},
"clouds":{"all":75},
"dt":1558544075,
"id":3469058,
"name":"Brasilia"}
];
const myArr = [
3451190, 3448439, 3405814, 3469058, 3405863, 3450554, 3464975, 6320062, 3663517, 3397277,];
//create a third Array with the filter apiCallArr.id with myArr items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment