That's not how machine learning works. We don't program it to do specific tasks. We give it massive amounts of data and it learns from making predictions about the data. No one programmed ChatGPT to write poetry or javascript.