After reading this: https://www.joelonsoftware.com/2016/12/09/developers-side-projects/
I'm stuck with this:
Well… maybe. In the United States, if you hired Sarah as a contractor, she still owns the copyright on that work. That is kind of weird, because you might say, “Well, I paid her for it.” It sounds weird, but it is the default way copyright works. In fact, if you hire a photographer to take pictures for your wedding, you own the copies of the pictures that you get, but the photographer still owns the copyright and has the legal monopoly on making more copies of those pictures. Surprise! Same applies to code.
Is it the same copyright principle in France? If I make a big JavaScript "generic" implementation of something that I would like to re-use somewhere else, is it legal for me to do so?