Do you have to use esri js? Turf.js has a function called "along" that could be used for this, but you'd need to calculate the length of the line beforehand before halving it and sending that length into the .along() parameters. You could calculate the length in turf as well, or use esri if you prefer.
If it has to be esri js... have fun. I suppose that I would first get the length of the entire line using a geometry service (if this doesn't all need to be client side). From there, I would probably break the line into segments by iterating over its paths and then running along a those segments, getting the distance of each and keeping track until I found the right segment to finally drop a point with whatever distance I had left at an angle calculated from the segment endpoints.
Lucky for you, someone else already wrote this and seems to have cut out the step of exploding the geometry for us. How convenient!