HTML Academy
Summary of “Objects”. Part 1
Objects21/30
Back to the list of tasks
  • 1. Shall we play?
  • 2. Players, let’s start!
  • 3. My attempt number one
  • 4. Hello, object!
  • 5. Reading from the object
  • 6. Count off!
  • 7. Overriding object properties
  • 8. Passing object by a link
  • 9. My game
  • 10. Giving out the attempts
  • 11. Who is the winner?
  • 12. Announce the entire list, please
  • 13. Looking for a cat with great results
  • 14. No one will hide
  • 15. New conditions
  • 16. Hard to come across
  • 17. Let’s bring it all to light
  • 18. Roll the dice, gentlemen cats!
  • 19. Let’s make adjustments
  • 20. Summary of “Objects”. Part 1
  • 21. Tenth program: “Golden ball”
  • 22. Build it yourself!
  • 23. My first method
  • 24. Implementing methods
  • 25. Object as a dictionary
  • 26. Bracket notation
  • 27. Let’s not forget about the context
  • 28. Store check
  • 29. Summary of “Objects”. Part 2
  • 30. Eleventh program: “The house that Muffin built”
Build it yourself!
  • Sign up
  • Log in

Register to take up challenges

Registration will only take a minute and let you save your study progress. You can register with your email and password or login via social networks.

or
Log in and continue
  • script.js
JavaScript
var getStatistics = function (players) { }; /* Technical assignment Meow! I need a program that will calculate the usefulness and effectiveness of players based on their statistics. Design the code as a getStatistics function with one parameter: an array of players. Each football player in this array is described by an object with three fields: name (property name), goals scored (property goals) and goal passes (property passes). The function must return the same array, in which each player has two more fields added: effectiveness coefficient as per Muffin® (property coefficient) and performance (property percent). The effectiveness coefficient is calculated like this: multiply the player’s goals by 2 (because I think that goals are the most important thing) and add all passes of the football player that resulted in a goal to this value. The effectiveness (percentage of goals scored by a football player against the result of the whole team) is as follows: we determine the sum of the goals of all the players and find out how many percent of this number each football player scored. Round the value using Math.round(). */

What didn’t you like in this task?

Thanks! We’ll fix everything at once!

Console

The code has changed, click “Run” or turn autorun on.

Result

Cookies ∙ Privacy ∙ License Agreement ∙ About ∙ Contacts ∙ © HTML Academy OÜ, 2019−2025

VISAMastercard

Log in

or

Forgot your password?

Sign up

Sign up

or
Log in

Restore access

Have you forgotten your password or lost access to your profile? Enter your email connected to your profile and we will send you a link to restore access.

Forgot to connect your email to the profile? Email us and we’ll help.