I sometimes get frustrated with Objects in js.

Working with and modifying them seems to be really obnoxious. i think one of the key things that frustrates me with them is the way that there seems to be a mutability between objects being structured and based on strings.. not sure how to verbalize this. for example, two ways to access an object

const something = {
value: `string`,
otherValue: -1
}

But there's also some weird interoperability going on with methods like Object.defineProperty()[link]

Where that gets muddled. I can see that there are other values that can get passed to it like writable but that really doesnt matter because once the line becomes blurred between how to work with the data structure. When you go back and forth between turning the data structure into a glorified array through methods like .entries() and accessing direct value through string comparison/hashmapping, it becomes difficult to work with these structures.

By adlai
Uploaded on 2021-09-27 22:25:15
TAGS: