A code that creates a file called isEven with many if statements in the "files" directory.
It all started when I watched a video from the channel Theo - t3.gg, where the creator of the post, Andreas, created a program that generated a bunch of if and else statements to check whether a number was even or odd in the most optimized way possible.
My program isn't even close to being as optimized, it's the first time I've tried to use file creation with pure Node.js, reasons:
- Node is just not for this
- I really don't tried to optimized this much
and to be quite honest, this was actually fun to make :)
Create a file with only if()
npm run if
Create a file with only if() and else()
npm run ifelse
Create a file with only switch()
npm run switch
You may need to enter the values little by little like: 5000000, 10000000, 15000000
File | Limit |
---|---|
If | 15000000 |
Switch | 10000000 |
If Else | 1636 |
the limits are still being tested