Js logic building

Does anyone have any tips for logic building for Js functional problems mostly, like i understand most of the code i go through later on , but many times unable to just come up with the intution, also like it’s little different from normal logics we write for basic functions, like recently i implemented Currying, but then i thought i’d be able to come up with the logic of currying with placeholders support on my own, but i couldn’t so like how much should one practice to and from where to start getting intution build on our own?

TO come up with the code for functional programming concepts like currying and currying with placeholder support