Chapter 3 why decrement hp is a pure function if it modifies input argument

Author: happytomatoeCreated Jul 2, 2023Updated Jan 25, 2024

Why decrement hp is a pure function if it modifies input argument - const decrementHP = p => p.set('hp', p.get('hp') - 1); For it to be pure shouldn't it at least copy the map content before changing the value? If you run this in multithreaded env you will get a lot of troubles.

Source: MostlyAdequate/mostly-adequate-guide