forked from engindemirog/javaScriptStarterKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.js
More file actions
31 lines (22 loc) · 752 Bytes
/
map.js
File metadata and controls
31 lines (22 loc) · 752 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
let cart = [
{ id: 1, productName: "Telefon", quantity: 3, unitPrice: 4000 },
{ id: 2, productName: "Bardak", quantity: 2, unitPrice: 30 },
{ id: 3, productName: "Kalem", quantity: 1, unitPrice: 20 },
{ id: 4, productName: "Şarj Cihazı", quantity: 2, unitPrice: 100 },
{ id: 5, productName: "Kitap", quantity: 3, unitPrice: 30 },
{ id: 6, productName: "Pot", quantity: 5, unitPrice: 150 },
];
cart.map(product=>{
console.log(product.productName + " : "+ product.unitPrice*product.quantity)
})
function addToCart(sepet) {
sepet.push({ id: 7, productName: "Ruhsat", quantity: 1, unitPrice: 20 });
}
addToCart(cart)
console.log(cart)
let sayi=10
function sayiTopla(number) {
number+=1
}
sayiTopla(sayi)
console.log(sayi)