Write a JavaScript function to get the month end date