Returns the last day in the month before that month that contains the CalculationDate.
var date = now.valueOf('2017-03-15');
var endOfMonth = date.endOfPreviousMonth();
console.log('endofLastMonth = %s', endOfMonth);
//endOfLastMonth = 2017-02-28 00:00:00