-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask05.html
More file actions
41 lines (40 loc) · 890 Bytes
/
task05.html
File metadata and controls
41 lines (40 loc) · 890 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
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script>
'use strict'
const products = [
{
id: 3,
price: 127,
photos: [
"1.jpg",
"2.jpg",
]
},
{
id: 5,
price: 499,
photos: []
},
{
id: 10,
price: 26,
photos: [
"3.jpg"
]
},
{
id: 8,
price: 78,
},
];
let filtered = products.filter(function(item){return item.photos !== undefined && item.photos.length != 0})
console.log(filtered)
</script>
</body>
</html>