Obviously it takes two parameters of new element and the one to insert data before but I am talking about “what will happen” using this funcrion.
“There is always more than one simple or straight forward way to do the job”.
And the other thing is with trying different options in coding, your mind learns to never stop and always be creative and alert to find out what possible solutions could be found.
It is a good practice for mind to learn “keep trying various ways of doing a task”.
So never stop practicing as perfection comes from lots of practice.