syntax meaning of ' (method) alert(message?: any): void ' in 'window.alert()' in javascript?

In Visual Studio Code, while making a react app when I move my cursor on window.alert(), I see a pop up which reads as follows:

alert(message?: any): void; 
(method) alert(message?: any): void

Please explain what it means, as I am from java background and I can’t understand it. I could only understand that alert() is a method which returns nothing, but what about it’s parameters?

What is (message?: any)?

60 thoughts on “syntax meaning of ' (method) alert(message?: any): void ' in 'window.alert()' in javascript?”

Leave a Comment