Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Article {
- title;
- comments;
- constructor(title) {
- this.title = title;
- this.comments = [];
- }
- comment = class Comment {
- info;
- logs;
- constructor(info) {
- this.info = info;
- this.logs = [];
- }
- moreInfo = class MoreInfo {
- information;
- constructor(information) {
- this.information = information;
- }
- }
- };
- }
- let art = new Article('My Article');
- let comment = new art.comment('comment1');
- comment.logs.push(new comment.moreInfo('moreInfo1'))
- art.comments.push(comment)
- console.log(art.comments[0].logs[0].information); // moreInfo1
Advertisement
Add Comment
Please, Sign In to add comment