You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect Person and Person2 to behave the same given the JSDoc "types" age to be a number.
/** * @param {number} age */functionPerson(age){this.age=age;// <- it knows age is a number}functionPerson2(){this.age=13;}varp1=newPerson();varp2=newPerson2();vara=p1.age;// <- it doesn't know this is a numbervarb=p2.age;// <- it knows this is a number