text: Program to find the mid | function to find the midpoint of a line ; Driver code
code: function midpoint ( x1 , x2 , y1 , y2 ) { document . write ( ( x1 + x2 ) / 2 + " " + ( y1 + y2 ) / 2 ) ; } let x1 = - 1 , y1 = 2 ; let x2 = 3 , y2 = - 6 ; midpoint ( x1 , x2 , y1 , y2 ) ;