Skip to content

Instantly share code, notes, and snippets.

@zt4ff
Created March 14, 2022 21:45
Show Gist options
  • Save zt4ff/ede309203ced2fcefa650e479ee622f5 to your computer and use it in GitHub Desktop.
Save zt4ff/ede309203ced2fcefa650e479ee622f5 to your computer and use it in GitHub Desktop.
// index.js
let counter = 0;
const generateId = () => {/* */};
class StudentManagement {
constructor() {/**/}
add() {/**/}
getStudent(studentIdOrName) {
if (studentIDOrName) {
return this.#students.filter(
(student) =>
studentIDOrName === student.id || studentIDOrName === student.name
);
}
return this.#students;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment