Please stop posting AI-generated answers to StackOverflow. Please. Most are just low-quality. Some are filled with subtle mistakes. If the asker wanted an AI-generated answer, they would have gone to an AI, not SO. You typing it into ChatGPT for them helps no one.
And they tend to be really obviously AI-generated. It's not as hard to notice the style as I thought it would be. ChatGPT doesn't write like most SO contributors. So I throw the question in myself, and see if I get answers like yours.