Weird problem when i try to format string to date in Angalar : I try to format string to Date.

    this.deadLine = new Date(this.deadLine);
When i console this i got "Invalid Date".

The output of this.deadLine without a format is:

    "2019-10-21T21:00:00.000Z"

If i do it without a variable like this its work:

    const a = new Date("2019-10-21T21:00:00.000Z")
    console.log (a) 
The output good

    Tue Oct 22 2019 00:00:00 GMT+0300 (Israel Daylight Time)

Why its not work on this.deadLine in the first line???

