Finding all properties of a javascript class
Posted
by uzay95
on Stack Overflow
See other posts from Stack Overflow
or by uzay95
Published on 2010-04-09T10:30:26Z
Indexed on
2010/04/09
10:33 UTC
Read the original article
Hit count: 145
JavaScript
I have classes looks like below:
function Student(name, surname, lossons){
this.Name = name;
this.Surname = surname;
this.Lessons = lessons;
}
function Lesson(){
this.Name = name;
this.studentCount = count;
}
And i want to write ToString method to them. But i don't want to write and add them one by one. Is there any way to do this like reflection in C# or Java ?
Any help would be appreciated...
© Stack Overflow or respective owner