How do I keep objects destroyed between scenes?

For example:

Player is in Scene A or Level 1 and there are 100 collectible “coins” in Scene A
The player then collects 50 or a number of these coins leaving 50 coins left
Then, the player leaves to another area or different scene, Scene B.
Eventually, the player returns to Scene A

How do I make the scene only have the 50 coins the player didn’t collect rather than it resetting to 100 coins?

btw, I’m using JavaScript in my project if there is a coding solution.

I’m not sure I understand, but could this be what you mean?