Fix addItemToCart example to return CartItem array instead of object

This commit is contained in:
Nik Mouzourides 2019-02-05 12:56:25 +00:00 committed by Dumitru
parent 4c6d10ce64
commit f5d8cb566a

View file

@ -685,7 +685,7 @@ function addItemToCart(cart: CartItem[], item:Item):void {
```ts
function addItemToCart(cart: CartItem[], item:Item):CartItem[] {
return {...cart, { item, date: Date.now() }};
return [...cart, { item, date: Date.now() }];
};
```