Last active
January 24, 2022 11:06
-
-
Save ilamanov/748b4fdc71624d66db42fa39937653a5 to your computer and use it in GitHub Desktop.
categorizer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function CATEGORIZE(transaction) { | |
| const [card, date, description, amount] = transaction[0] | |
| if (description.toLowerCase().includes("starbucks") || | |
| description.toLowerCase().includes("taqueria")) { | |
| return "takeout" | |
| } else if (description.toLowerCase().includes("carwash") || | |
| description.toLowerCase().includes("chevron") || | |
| description.toLowerCase().includes("exxon")) { | |
| return "car" | |
| } else if (description.toLowerCase().includes("youtubepremium") || | |
| description.toLowerCase().includes("netflix") || | |
| description.toLowerCase().includes("spotify") || | |
| description.toLowerCase().includes("amazon")) { | |
| return "subscriptions" | |
| } else { | |
| return "" | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment