Inheritance Using Prototype In Javascript Mdn Array Reduce In Php