Posts

Showing posts from January 20, 2019

Talk:Michael Neher

Image
[dummy-text] Talk:Michael Neher From Wikipedia, the free encyclopedia Jump to navigation Jump to search            This article is of interest to the following WikiProjects: WikiProject Biography / Arts and Entertainment (Rated Stub-class) Biography Wikipedia:WikiProject Biography Template:WikiProject Biography biography articles Biography portal v t e This article is within the scope of WikiProject Biography , a collaborative effort to create, develop and organize Wikipedia's articles about people. All interested editors are invited to join the project and contribute to the discussion. For instructions on how to use this banner, please refer to the documentation.  Stub  This article has been rated as Stub-Class on the project's quality scale. This article is supported by the arts and entertainment work group .   WikiProject Visual arts (Rated Stub-class) Visual arts Wikipedia:WikiProject Visual arts Template:WikiProject Visu

ES6 Function result is showing NaN

Image
-2 I have make a ES6 class function, I can't understand why the console result is showing NaN class Person constructor(firstName, lastName, dob) this.firstName = firstName; this.lastName = lastName; this.birthday = new Date(dob); greeting() return `Hello there, This is $this.firstName $this.lastName`; calculateAge() const diff = Date.now() - this.birthday.getTime(); const ageDate = new Date(diff); return Math.abs(ageDate.getUTCFullYear() - 1995); const niran = new Person('Niran', 'Yousuf', '26-12-1992'); console.log(niran.calculateAge()); javascript es6-class share | improve this question asked Nov 11 '18 at 3:10 Niran Yousuf Niran Yousuf 55 9 Have you tried debugging this? console.log(niran.birthday) -> Invalid Date – tkausl Nov 11 '18 at 3:12 add a comment  |  -2 I have make a ES6 class function, I can't understand why the console result is showin