36
loading...
This website collects cookies to deliver better user experience
const property = getProperty();
console.log(property) // null
const user = getUser();
console.log(user) // undefined
const userPropertyValue = user[property] // <- error. user is undefined
Sure the "property" variable being null is a bug as well. For our study case lets focus on user undefined. "Property null" could be a consequence of user undefined too. Like we could think the context of this code is inside a sanitize function. That function removes undefined / null / NaN of a user object, which is undefined.
Maybe this isn't the best relationship for this case but lets focus on it for our study case
const collectionNameList = ['User', 'UserPurchase', 'Order', 'Item'];
**User:613514b8d5ae0e081ca7cd2d // value
VXNlcjo2MTM1MTRiOGQ1YWUwZTA4MWNhN2NkMmQ= // base64 encode**
<domain>/user/VXNlcjo2MTM1MTRiOGQ1YWUwZTA4MWNhN2NkMmQ=/details
a related localhost in 8080 port url would be: localhost:8080/user/VXNlcjo2MTM1MTRiOGQ1YWUwZTA4MWNhN2NkMmQ=/details
. Because in MongoDB we can create new documents by a pre-created unique identifier (ObjectId) the same url will exist for the same user page.