get json by id

Solutions on MaxInterview for get json by id by the best coders in the world

showing results for - "get json by id"
Valerio
04 Jan 2018
1const foo = { "results": [
2    {
3        "id": 12,
4        "name": "Test"
5    },
6    {
7        "id": 2,
8        "name": "Beispiel"
9    },
10    {
11        "id": 3,
12        "name": "Sample"
13    }
14] };
15foo.results.find(item => item.id === 2)
16