skip to Main Content

Not sure if i'm using oop in javascript correctly

Im learning OOP and decided to create a project using it. I feel like I'm not sure if I'm using it correctly. const btnCalculate = document.getElementById('work'); const spanOne = document.querySelector('.first'); const spanTwo = document.querySelector('.second'); class PayDay{ constructor(hours, payRate){ this.hours =…

VIEW QUESTION

PHP Include All Functions in Directory Inside Class

Is there a possibility of including all functions within directory within a class. For example: class.php class all_functions{ foreach(glob(__DIR__.'/functions/*.php') as $file){include($file);} } functions/function1.php function hello(){ echo 'hello'; } functions/function2.php function goodbye(){ echo 'goodbye'; } Result would be a class all_functions()…

VIEW QUESTION
Back To Top
Search