Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ArticleData {
- constructor() {
- this.urls = [];
- this.titles = [];
- this.publishers = [];
- this.dates = [];
- this.similarities = [];
- }
- addArticle(url, title, publisher, date, similarity) {
- this.urls.push(url);
- this.titles.push(title);
- this.publishers.push(publisher);
- this.dates.push(date);
- this.similarities.push(similarity);
- }
- getArticle(index) {
- return {
- url: this.urls[index],
- title: this.titles[index],
- publisher: this.publishers[index],
- date: this.dates[index],
- similarity: this.similarities[index]
- };
- }
- getAllArticles() {
- const articles = [];
- for (let i = 0; i < this.urls.length; i++) {
- articles.push(this.getArticle(i));
- }
- return articles;
- }
- // Add any additional methods or functionality you need
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement