![]() ![]() This makes our code reusable and modular. We can easily declare a new function to call filter using anything else, and we would only need to swap out what we call in filter, additionally, if we need to capitalize any other word in the future, we already have a captializeWord function that does it. If we want to see with more detail what we are doing, we can go to the declarations for further clarification. Here we can see that we are filtering stock over 5, then capitalizing the names, and the getting the total and item list just by reading through that last line of code. ![]() Const itemsWithVatFor = for ( const item of items )
0 Comments
Leave a Reply. |