Document the project structure and setup while excluding local dependencies and IDE settings. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
24 lines
489 B
JavaScript
24 lines
489 B
JavaScript
class MyFunc {
|
|
_invoke(func_name, a, b) {
|
|
switch (func_name) {
|
|
case 'add':
|
|
return this._add(a, b);
|
|
case 'subtract':
|
|
return this._subtract(a, b);
|
|
default:
|
|
throw new Error(`Invalid func name, ${operation}`);
|
|
}
|
|
|
|
}
|
|
|
|
_add(a, b) {
|
|
return a + b;
|
|
}
|
|
|
|
_subtract(a, b) {
|
|
return a - b;
|
|
}
|
|
}
|
|
|
|
const myFunc = new MyFunc();
|
|
console.log(myFunc._invoke("add", 10, 5)) |