Evaluate if the following function is a good candidate to be placed in a library. Why or why not?
(Level 5 UNIT 7)
This function is not a good candidate to be placed in a library. The creator of the library is attempting to update the global variables player1Points and player2Points. Because this is being peformed inside of a function, the updated scores for each player won't be retained unless someone creates the global variables player1Points and player2Points in their program. Alternatively, the function may be rewritten using the parameters playerPoints (existing score of each player) and points (additional score to be added) instead:
function updateScore(playerPoints, points) {
Return playerPoints + points
}

Respuesta :

This function is not a good candidate to be placed in a library. The creator of the library is attempting to update the global variables player1Points and player2Points.

What is library?

A library is a collection of materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or digital access (soft copies) materials, and may be a physical location or a virtual space, or both. A library's collection can include printed materials and other physical resources in many formats such as DVD, CD and cassette as well as access to information, music or other content held on bibliographic databases.  A library, which may vary widely in size, may be organized for use and maintained by a public body such as a government; an institution such as a school or museum; a corporation; or a private individual.

To know more about library visit:

https://brainly.com/question/29774090

#SPJ4