- 3

JS function solution?

//function outside of constructor function and associate it with objects function Person(name,age){ this.name=name; this.age=age; } function age(){ return 2021-this.age; } var P=new Person(1998); document.write(P.age());

21st Jan 2021, 5:39 AM
Gayan $
Gayan $ - avatar
3 odpowiedzi
+ 1
yes there is only javascript then why have you put tags for html css php
21st Jan 2021, 6:10 AM
Steve Sajeev
Steve Sajeev - avatar
- 1
Pls use appropriate tags for more faster solutions Remove css css3 html php And Use tags like js javascript functions objects constructors
21st Jan 2021, 5:41 AM
Steve Sajeev
Steve Sajeev - avatar
- 1
There is javascript only bro
21st Jan 2021, 5:46 AM
Gayan $
Gayan $ - avatar