Skip to content

Instantly share code, notes, and snippets.

@vmlf01
vmlf01 / index.ts
Last active January 28, 2024 23:08
TypeScript training - module 2 sample
// sample shopping cart data
const shopping_cart = {
items: [
{ id: '1', name: 'T-Shirt Game of Thrones', size: 'XL', taxCode: 'IVA23', quantity: 1, unitPrice: 24.99 },
{ id: '2', name: 'T-Shirt Big Bang Theory', size: 'L', taxCode: 'IVA23', quantity: 2, unitPrice: 12.50 },
],
subTotal: 0,
tax: 0,
total: 0,
};
@vmlf01
vmlf01 / module1.final.ts
Last active October 27, 2017 08:19
TypeScript training - module 1 sample
const itemsList = [
"eggs",
"milk",
"donuts",
"butter",
"coca-cola",
];
function itemize(items: string[]): string[] {
return items