How to implement guide with date comparison in typescript - incorrect results with date objects
I'm performance testing and I can't seem to get I'm getting frustrated with I am working with an scenario when comparing two Date objects in TypeScript... I expected the comparison to give me the correct order based on their timestamps, but it seems to be yielding unexpected results. Here's a snippet of my code: ```typescript const date1 = new Date('2023-10-01T12:00:00'); const date2 = new Date('2023-10-01T12:00:01'); if (date1 < date2) { console.log('date1 is less than date2'); } else { console.log('date1 is not less than date2'); } ``` When I run this code, I see the output: "date1 is not less than date2", which is confusing because `date1` should clearly be earlier than `date2`. I also tried using `date1.getTime() < date2.getTime()`, which worked as expected, but I want to understand why the direct comparison using `<` isn't functioning as I anticipated. I'm using TypeScript version 4.5.2 and running this in a Node.js environment. Is there a specific reason why direct comparison between Date objects fails? Could it be related to how TypeScript handles object comparison? Any insights or best practices for comparing Date objects in TypeScript would be greatly appreciated. This is for a service running on Windows 11. I appreciate any insights! For context: I'm using Typescript on Ubuntu 20.04. Is this even possible?