The Best Code Editor for frontend development is VSCode.
It's free, powerful, and intensely flexible.
It can pretend to be a simple text editor, or with the addition of extensions, can be as full featured as any modern IDE.
It's supported by Microsoft with a full engineering team working on it daily. New major versions are released every month and it has a strong and energetic community building extensions for it.
If you're a fan of TypeScript then you'll love the tight and strong integration VSCode provides, making it an absolute joy to write TypeScript.
Runner up: Sublime Text
Sublime Text does not have a full team of Microsoft engineers working on it, nor does it have as vibrant of an ecosystem building add-ons for it, but one thing it does have an advantage over VSCode is its speed.
Sublime Text is very fast. It opens in milliseconds and can handle large files far better than VSCode.
Like VSCode, Sublime Text ranges from acting like a text editor to an IDE, however the amount of extensions required to beef up Sublime Text to IDE status is a bit longer.
For most common frontend tasks Sublime Text is more than capable, especially when mixed with the right combination of extensions.
Sublime Text requires a license for continued use but also provides a non-expiring evaluation option. The evaluation option will prompt you every so often to purchase a license (which you should!) but otherwise still works without issue or constraint.
For most of your daily coding needs Sublime Text is fine. However the community mindshare is definitely more focused on VSCode nowadays.
Other Options
If you want a fully featured IDE then IntelliJ IDEA is a great choice for backend and frontend developers alike. It's much more expensive compared to our other picks however it provides everything you might need for JavaScript or Java development. It's beloved by many (more so backend developers) but it should not be overlooked for its ability to make frontend development a joy as well.
Without Atom it's unlikely that VSCode would exist. It's essentially VSCode, except it came out first, and is no longer as popular. It's biggest flaw is that it's much slower compared to VSCode and all other editors listed. That was one of its main weaknesses that allowed VSCode to gain and overtake it in popularity. At this point you shouldn't use Atom, just use VSCode instead.