Returns a new CalculationDate relative to the CalculationDate on the same day of the month for the month previous to the one that contains the CalculationDate. 

var date = now.valueOf('2017-03-15'); 

var lastMonth = date.lastMonth();

console.log('lastMonth = %s', lastMonth);

//lastMonth = 2017-02-15 00:00:00

When the previous month has fewer days and the CurrentDate cannot match the day of the month the date is shifted to always be the end of the previous month. 

var date = now.valueOf('2017-03-31'); 

var lastMonth = date.lastMonth();

console.log('lastMonth = %s', lastMonth);

//lastMonth = 2017-02-28 00:00:00
Did this answer your question?