When using the article document class, I can customise the title of the table of contents like so:
\documentclass{article}
\renewcommand{\contentsname}{Whatever}
\begin{document}
\tableofcontents
\section{Section}
\subsection{Subsection}
\end{document}
As expected, the title of the table of contents is now "Whatever". However, if I change the first line to use the scrartcl document class
\documentclass{scrartcl}
then I'm back to the default "Contents" as the title. I've looked through the KOMA-Script user guide, and it seems like this should still work. I read section 12.4, "Defining Language-Dependent Terms", but a) I didn't understand how to use it, and b) I'm not trying to do anything language-dependent.
Is there a different/better way to do this in document classes that use KOMA-Script?
I'm using xelatex, if it matters.

\renewcommand{\contentsname}{Whatever}below\begin{document}. – Marijn Sep 09 '22 at 20:25scrartcl, by the way. You should do\AtBeginDocument{\renewcommand{\contentsname}{Whatever}}– egreg Sep 09 '22 at 21:24