I posted the original question about a WPF .NET Application not crossing the international dateline, https://community.esri.com/thread/237169-polyline-not-crossing-international-dateline. When taking that same solution, of adding or subtracting 360 based on the polyline direction, the ESRI Javascript API v4.12 still stops at the International Dateline.
WPF .NET app (See the blue line below)

Using the ESRI Javascript API v4.12, the fix stops drawing the line at the International dateline.

I was just curious why with .NET the fix works but not with Javascript. And what is the fix for javascript?
Thanks for your help.