mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
26 lines
440 B
JavaScript
26 lines
440 B
JavaScript
// Class definition
|
|
class Person {
|
|
constructor(name) {
|
|
this.name = name;
|
|
}
|
|
|
|
sayHello() {
|
|
return `Hello, ${this.name}!`;
|
|
}
|
|
}
|
|
|
|
// Function declaration
|
|
function greet(person) {
|
|
return person.sayHello();
|
|
}
|
|
|
|
// Variables and constants
|
|
const DEFAULT_NAME = 'World';
|
|
let currentPerson = new Person(DEFAULT_NAME);
|
|
|
|
// Export for use in other modules
|
|
module.exports = {
|
|
Person,
|
|
greet,
|
|
DEFAULT_NAME
|
|
};
|