Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I need a typescript function which takes in an object with an id string property and a string message property, and also takes an array of search strings, and returns a mapping of search strings to matching message ids

Your prompt is wrong. You want a function that takes an array of id/message objects, not an object.

It's quite impressive that GPT is just able to correct for that. As a human, I would first ask what you actually mean, because your prompt appears to be unclear.



Actually it was meant to be an object mapping of ids to messages, but yes, I phrased it weirdly. Both LLMs understood that part, though.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: