Is there a way to let a javascript function know that a certain parameter is of a certain type?
Being able to do something like this would be perfect:
No, instead you would need to do something like this depending on your needs:
function myFunction(myDate, myString) { if(arguments.length > 1 && typeof(Date.parse(myDate)) == "number" && typeof(myString) == "string") { //Code here } }