1
00:00:01,000 --> 00:00:05,200
So now we're recreating the function that is going to differentiate between our income as well as expenses.

2
00:00:05,620 --> 00:00:10,780
So for that purpose, let us create a contact amount that is going to be used by both our income as

3
00:00:10,780 --> 00:00:12,010
well as our expenses.

4
00:00:12,490 --> 00:00:20,770
So let's just create a cost amount and this is going to be let's just transactions dirt map and it is

5
00:00:20,770 --> 00:00:28,270
going to take a single transaction and a return of transactions that amount.

6
00:00:32,730 --> 00:00:33,570
Not amount.

7
00:00:38,170 --> 00:00:42,280
Because the amount of money that we're having in each entry, right?

8
00:00:42,640 --> 00:00:46,420
So we are having the transactions and we are mapping them one by one.

9
00:00:47,020 --> 00:00:54,530
Now let's create the two cards which were in our expense sheet, the income and the expense one.

10
00:00:54,550 --> 00:00:55,870
So let's just create a constant.

11
00:00:56,200 --> 00:00:57,820
And this is going to be an income.

12
00:00:59,680 --> 00:01:02,440
Now this income is going to take that amount.

13
00:01:03,160 --> 00:01:09,040
Now they're going to be three functions that we are using of the JavaScript.

14
00:01:09,190 --> 00:01:15,340
One is going to be the filter and the filter will be using the reduced function.

15
00:01:16,500 --> 00:01:18,210
To add up all what is in there.

16
00:01:20,090 --> 00:01:23,840
And electoral dysfunction will be using two fixed.

17
00:01:25,500 --> 00:01:30,200
You know, as you might already know, we are using filters to reduce the amount to filter out all the

18
00:01:30,200 --> 00:01:35,330
positive values, the only one, the positive areas to be in here and to reduce to add up all the values

19
00:01:35,330 --> 00:01:40,100
and low fixed so that our values decimal point, there's not more than two.

20
00:01:40,610 --> 00:01:45,950
So two fixed always need to have only two numbers at the end after the decimal point.

21
00:01:46,550 --> 00:01:52,610
And this is going to be same for both income as well as expenses copied and pasted.

22
00:01:53,000 --> 00:01:54,250
This is going to be a.

23
00:01:56,170 --> 00:01:56,830
Expense.

24
00:02:00,940 --> 00:02:05,530
Now inside of her, and we're just filtering out all positive numbers.

25
00:02:05,890 --> 00:02:12,760
So this is going to take up an item and we will ensure that the item is always greater than greater

26
00:02:12,760 --> 00:02:13,260
than zero.

27
00:02:16,620 --> 00:02:23,340
And if the item is greater than zero, then we want to reduce that particular element and instead reduce

28
00:02:23,340 --> 00:02:24,360
function well, right?

29
00:02:25,860 --> 00:02:33,990
We'll take two parameters around as well as item amount item, and we'll be adding.

30
00:02:36,790 --> 00:02:37,420
The amount.

31
00:02:48,800 --> 00:02:52,550
And it is going to be fixed to do numbers now if you just hit safe.

32
00:02:52,760 --> 00:02:55,760
And apart from this, we will also be having a zero.

33
00:03:05,420 --> 00:03:07,820
It safe, OK, so we have configured our income.

34
00:03:10,090 --> 00:03:16,600
Known, say, the expense column we are going to use the same what we used in our filter of income,

35
00:03:16,600 --> 00:03:19,720
but this time the items is supposed to be less than zero.

36
00:03:20,740 --> 00:03:23,260
So this time we would be using less than zero.

37
00:03:24,450 --> 00:03:27,450
And inside the reduced function will be adding up.

38
00:03:28,200 --> 00:03:30,210
So it is going to be the same as this.

39
00:03:37,080 --> 00:03:43,800
And even this time, we want it to be fixed to zero, so we have used the expense column as well, and

40
00:03:43,800 --> 00:03:47,160
our income know it's time to use them inside our application dynamically.

41
00:03:47,550 --> 00:03:55,230
So head back to your typography where you have added plus income and selected and now will just put

42
00:03:55,230 --> 00:03:57,540
up income dynamically.

43
00:03:59,550 --> 00:04:01,740
And in the expense, be having expense.

44
00:04:08,090 --> 00:04:09,950
So we is fully clear to that function.

45
00:04:10,130 --> 00:04:14,300
And now what remains is the mixed, so we'll be configuring it next.
