Lately I've been rewriting some old JS into TypeScript, and doing so really shows you what the value of TypeScript is. It's actually genuinely difficult to know what types are flowing through the code. In TS you only need to see the immediate function code, but in JS you might need to read quite far back and follow a really long code path.
I always struggled with this in the past and considered data the hardest part about programming. How is your input data structured, how do you change it throughout the code, where do you need what aspects of the input data, and so on. That's really what complicates code. Simple and clear data results in easy code, and types facilitate that.
Even if you're not using a statically typed language, if you're working on a project, take some time to really think about your input data, intermediate data (subsets/transforms that you'll need for your internal functions), and output data first, before you really start coding. Don't just start coding without an idea of them. They don't have to be final of course, but at least clarify it before you start.

@dada78641 and with native support in node and other runtimes, it no longer has as big of a complexity floor as it used to have!

Nowadays it’s definitely a better language to write than plain JS