I'm learning data structures and algorithms with JavaScript and TypeScript. Since I already use those languages for web development, they're the most natural choice for me. However, I often see C++, Java, and Python recommended for DSA, and I'm wondering whether I'm missing anything important by sticking with JS/TS. I'm not focused on competitive programming or interview preparation—I mainly want to understand DSA properly and improve my general problem-solving skills. Would it be worth learning another language specifically for this, or should I continue with the languages I already know?
3 Answers
JS/TS is perfectly capable, but occasionally implement core structures yourself instead of relying entirely on built-in methods. For example, write a queue without using an inefficient front-removal operation, or build a simple hash table and linked list. That helps you understand what the abstractions are doing underneath. If you later want to learn memory management and lower-level implementation details, C or C++ can be useful as a separate learning exercise—not because you need them to learn algorithms.
A good compromise is to learn the concept in TypeScript first, then port selected algorithms to another language afterward. The algorithm itself is usually language-independent, which is why many textbooks use pseudocode. Translating an implementation can show you differences in memory handling and standard libraries without adding unnecessary friction at the beginning.
You can absolutely learn DSA with JavaScript or TypeScript. Since you already know the languages, you can spend your energy understanding algorithms instead of fighting unfamiliar syntax. The common recommendations for C++, Java, and Python often come from competitive programming, where factors like execution speed, standard libraries, and low-level control matter more. Those concerns usually aren’t important for your goal.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically