How to type check a Date object in flow?

11,441

Thanks loganfsmyth and Nikita for the comments. It works as expected.

function diffDate (start: Date, end: Date) {
   // ...
}
Share:
11,441

Related videos on Youtube

Aakash Sigdel
Author by

Aakash Sigdel

Mobile and Frontend developer with love for React and React-Native

Updated on June 04, 2022

Comments

  • Aakash Sigdel
    Aakash Sigdel almost 2 years

    I have a function that takes a Date object as its paramater. I am not able to figure out how to annotate this.

    function diffDate (start: any, end:any) {
    //....
    }
    How do I type annotate start and end as Date objects?