How to get Javascript Date() object from a Date field (in a template)?

This isn’t working:
<%= new Date( task['Due Date'] ).toLocaleDateString() %>

It just results in the string “Invalid Date”.