-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfilter.js
More file actions
30 lines (25 loc) · 847 Bytes
/
Copy pathfilter.js
File metadata and controls
30 lines (25 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const allUsers = [
{
name: "Marina",
lastName: "Kim",
},
{
name: "Elena",
lastName: "Last name 1",
},
{
name: "Julia",
lastName: "Last name 2", // key value pair
},
];
// .filter --> in-built method in JavaScript to work with Array
// task: filter the list of users to include only Julia
console.log(allUsers.filter((user) => user.name === "Julia")[0]); // filter the list to only include elements with value "Julia"
// запрос к АПИ (нам нужно получить все товары из Германии)
// Бэкенд отправляет запрос к базе данных (SQL Query)
// Database schema -->
// usersTable
// Marina --> linked with ordersTable
// ordersTable
// orderId, userName (Marina), orderAmount (USD 100)
// orderId, userName (Marina), orderAmount (USD 1000)