I've done a little bit of javascript but I was doing a hobby project with a raspberry pi. That meant learning python and linux. Chatgpt was invaluable in completing the project because although I know the very basics I don't know the libraries. The script Chatgpt provided based on my description included several libraries that are super common and useful but I had never heard of. So instead of trying to reinvent the wheel or endlessly googling until I found something that sort of did what I wanted and then looked at that code, I was able to get something that worked. Then I could adjust it and add features.
But the fact remains that if you did all those things yourself, although much slower and more frustrating at times, you would have learned and remembered more, and would have understood the task, the libraries, and your own program on a deeper level.
Which many times is the actual point of the exercise.