Comments on: How to work with Javascript objects https://blog.debugeverything.com/how-to-work-with-javascript-objects/ A new way to learn programming Wed, 01 Feb 2023 20:27:39 +0000 hourly 1 https://wordpress.org/?v=7.1.4 By: Kevin https://blog.debugeverything.com/how-to-work-with-javascript-objects/#comment-1400 Wed, 01 Feb 2023 20:27:39 +0000 https://debugeverything.com/?p=473#comment-1400 I’d like to comment. I see this a lot: objects with internal arrays and how to use array methods with them, etc. But what about an Object of objects? What is the advantage or disadvantage of using Objects without organizing the data without internal arrays?
const user = {
id42: { address1: {
street: “Av Brasil, 200”,
city: ‘São Paulo’,
country: “Brazil”,
mainAddress: true
},
address2: {
street: “Av Atlantica, 150”,
city: ‘Rio de Janeiro’,
country: “Brazil”,
mainAddress: false
}
}
};

]]>
By: Adrian https://blog.debugeverything.com/how-to-work-with-javascript-objects/#comment-1251 Wed, 14 Dec 2022 17:39:28 +0000 https://debugeverything.com/?p=473#comment-1251 Didn´t work sadly. Tried console.log(user[‘address’][0]); with my array inside my object and got ‘undefined’ error messages.

]]>
By: 3 Powerful Ways to Access Properties in Javascript Objects - Debug Eveything https://blog.debugeverything.com/how-to-work-with-javascript-objects/#comment-22 Thu, 18 Jun 2020 00:24:39 +0000 https://debugeverything.com/?p=473#comment-22 […] You can use the dot property assessor in a chain to access deeper properties of an object: object.prop1.prop2. You have a specific article for that here. […]

]]>
By: 4 Better Ways to use the Javascript array filter method - Debug Eveything https://blog.debugeverything.com/how-to-work-with-javascript-objects/#comment-21 Tue, 26 May 2020 23:52:59 +0000 https://debugeverything.com/?p=473#comment-21 […] we need to interact over the objects as well, if you don’t know how to do it, just check this post and this one as […]

]]>
By: Javascript Array Filter() Method - Debug Eveything https://blog.debugeverything.com/how-to-work-with-javascript-objects/#comment-20 Fri, 01 May 2020 01:15:49 +0000 https://debugeverything.com/?p=473#comment-20 […] need to interact on the objects too, if you don’t know how to do it, just check this post and this one […]

]]>
By: 4 Ways to use the Javascript array filter method - Debug Eveything https://blog.debugeverything.com/how-to-work-with-javascript-objects/#comment-19 Tue, 28 Apr 2020 03:57:37 +0000 https://debugeverything.com/?p=473#comment-19 […] we need to interact over the objects as well, if you don’t know how to do it, just check this post and this one as […]

]]>
By: Javascript: 4 Ways to use the array filter method - Debug Eveything https://blog.debugeverything.com/how-to-work-with-javascript-objects/#comment-18 Wed, 01 Apr 2020 23:37:55 +0000 https://debugeverything.com/?p=473#comment-18 […] we need to interact over the objects as well, if you don’t know how to do it, just check this post and this one as […]

]]>
By: Javascript: How to iterate an Object using loops [With performance evaluation] - Debug Eveything https://blog.debugeverything.com/how-to-work-with-javascript-objects/#comment-17 Fri, 13 Mar 2020 05:35:33 +0000 https://debugeverything.com/?p=473#comment-17 […] what I did was this: I created a simple Object, (by simple, I mean that there are no nested properties) with 10,000 entries, and used the console.time() method to measure the time each method is […]

]]>
By: JavaScript: Which operator should you use for comparisons? - Debug Eveything https://blog.debugeverything.com/how-to-work-with-javascript-objects/#comment-16 Mon, 24 Feb 2020 22:10:09 +0000 https://debugeverything.com/?p=473#comment-16 […] you’re working with objects, simple objects here, let’s not deal with nested objects now. The restricted and abstract comparison works in different ways from the primitive types as I […]

]]>