How can I pass a string date from a variable to the new Date(...)
constructor? The following code produces Invalid Date
. Do I need to convert it first somehow?
var dateString = '18/11/2021';
var dateObject = new Date(dateString);
alert(dateObject);