JSON.stringify removes undefined, how to keep it

from blog Muffin Man, | ↗ original
This is something I keep rediscovering, because I keep forgetting it. JSON.stringify will omit all object attributes that are undefined. In most cases, it doesn't really matter, because if we parse that string back, and try to access that attribute - it will be undefined by design. Check the example below: const user = { name: 'Stanko', phone:...