Skip to content

Instantly share code, notes, and snippets.

@zt4ff
Created March 14, 2022 21:45
Show Gist options
  • Save zt4ff/6c3c41af99744f5ff4d9bf3fbf1a3f0b to your computer and use it in GitHub Desktop.
Save zt4ff/6c3c41af99744f5ff4d9bf3fbf1a3f0b to your computer and use it in GitHub Desktop.
// index.js
let counter = 0;
const generateId = () => {/* */};
class StudentManagement {
constructor() {/* */}
add() {/* */}
getStudent() {/* */}
score(id, performance) {
if (performance >= 0 && performance <= 100) {
this.#students.find((student) => {
if (student.id === id) {
student.performance = performance;
}
});
} else throw new Error("Score should be between 0 and 100");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment