Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 10 additions & 34 deletions dirty-control-structures.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,14 @@
main();

function main() {
const transactions = [
{
id: 't1',
type: 'PAYMENT',
status: 'OPEN',
method: 'CREDIT_CARD',
amount: '23.99',
},
{
id: 't2',
type: 'PAYMENT',
status: 'OPEN',
method: 'PAYPAL',
amount: '100.43',
},
{
id: 't3',
type: 'REFUND',
status: 'OPEN',
method: 'CREDIT_CARD',
amount: '10.99',
},
{
id: 't4',
type: 'PAYMENT',
status: 'CLOSED',
method: 'PLAN',
amount: '15.99',
},
];

class User{
const transactions(userData) = {
this.id = userData.id;
this.type = userData.type;
this.status = userData.status;
this.method = userData.method;
this.amount = userData.amount;
}
}
processTransactions(transactions);

}

function processTransactions(transactions) {
Expand Down