https://medium.com/@abdullahsaifullah988/javascript-checking-if-key-exists-for-smooth-operations-906c47b44d0b