[DAY 30-32] I Built A Spam Filter, Number Sorter, And Statistics Calculator
Tags: beginners, learning, javascript, webdev
Published: 2024-05-30 11:01:44

Hi everyone! Welcome back to another blog where I document the things I learned in web development. I do this because it helps retain the information and concepts as it is some sort of an active recall.

On days 30-32, I built a spam filter, a number sorter, a statistics calculator, and solved 9 leetcode challenges which are:

1. Score Of A String
2. Display The First Three Rows (Python)
3. Return Length Of Arguments Passed
4. Modify Columns (Python)
5. Add Two Promises
6. Reshape Data: Concatenate (Python)
7. Concatenation Of Array
8. Create A New Column (Python)
9. Convert The Temperature

In these projects, I learned regular expressions, basic algorithmic thinking, advanced array methods, and some python concepts, as well as some of its syntax. Also, my skills in data structures & algorithms have improved because of the leetcode challenges I solved despite being rated as easy.

_Regex_ or _regexp_ are regular expressions, they are patterns that are useful to programmers to match, search, and replace text. I had a hard time understanding this concept because they use so many special characters, lol, I can’t be alone…

In the spam filter project, the program works by checking if the inputted message is a spam. Here, I learned about regex syntax and some general knowledge of how to use it (e.g. to mark “FREE STOCK ALERT” in code, use the expression: `const myRegex = /(?:^|\s)fr[e3][e3] (?:^|\s)[s5][t7][o0][c{[(]k [a@4]l[e3]r[t7](?:$|\s)/i;`). Now, when a user input the following message (including its other counterparts like “FR33 M0N3YY!!” and etc.)

In the number sorter project, a user must input a set of numbers and upon pressing the button, the program will sort them from smallest to largest. I learned how to implement and visualize different sorting algorithms like bubble sort, selection sort, and insertion sort in JavaScript.

In the statistics calculator project, if a user inputs a set of numbers, the program will calculate it according to each function and output the answer. I gained experience in handling user input, DOM manipulation, and method chaining. I also practiced my skills by performing statistical calculations like mean, median, and mode in an array of integers.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xcewpobi0z5d75tzms8y.PNG)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d1sp46f57g8n0sfp9ird.PNG)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e3idsqjgeiesmt3udzh2.PNG)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rbrs6e8rpzhge35qo5zh.PNG)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uaai9aeufxu8pbe6kqx1.PNG)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vl0tupsb3hpf0il8d303.PNG)

I didn’t finish the statistics calculator in this blog because the lesson is a bit longer, so I just finished the part where the program calculates for the mean, median, and mode of the input. In the next blog, I’ll be continuing the lesson where I code a program that calculates for the range, variance, and standard deviation.

Anyways, that’s all for now, more updates in my next blog! See you there!