Skip to content

Commit

Permalink
add example output for typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
awekrx committed Mar 5, 2023
1 parent 59f925e commit f8afebe
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions results/js/example_commented.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

/**
* This class represents a user with a name property.
* @class
*
*/
class User {
/**
* Creates a new User instance with the given name.
* @constructor
* @param {string} name - The name of the user.
*
*/
constructor(name) {
this.name = name;
}
/**
*
* Returns the name of the user.
* @returns {string} - The name of the user.
*/
getName() {
return this.name;
}
}
const user = new User('John');
user.getName();
user instanceof User;

0 comments on commit f8afebe

Please sign in to comment.