₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,370 members, 8,421,588 topics. Date: Saturday, 06 June 2026 at 05:03 PM

Toggle theme

What's The Difference Between Hashmap And Objects - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingWhat's The Difference Between Hashmap And Objects (976 Views)

1 Reply (Go Down)

What's The Difference Between Hashmap And Objects by Tobedated(op): 10:43pm On Nov 09, 2022
Currently going through Grokking algorithms and it defines hashmap as key/value pairs but isn't that the same as object are they the same thing or what's the difference between the two
Re: What's The Difference Between Hashmap And Objects by chukwuebuka65(m): 11:05pm On Nov 09, 2022
Tobedated:
Currently going through Grokking algorithms and it defines hashmap as key/value pairs but isn't that the same as object are they the same thing or what's the difference between the two
Just see objects as a group of variables that are related together with methods to work on them. That’s the foundation of object oriented programming . Hash maps are just like array but with named indexes. I think javascript objects acts like hash maps and also like objects ( in the real sense of objects ie a group of related variables and functions to manipulate them).

You can google objects in programming in general to understand more.
Re: What's The Difference Between Hashmap And Objects by TastyFriedPussy: 6:56am On Nov 10, 2022
You'll later give up and I'll be here waiting for you when that eventually happens tongue rubbish..
Re: What's The Difference Between Hashmap And Objects by etoluw: 7:15am On Nov 10, 2022
Tobedated:
Currently going through Grokking algorithms and it defines hashmap as key/value pairs but isn't that the same as object are they the same thing or what's the difference between the two
In OOP objects are not key/value pairs . It is JavaScript that give you that impression.

Any key/value pair is a Map. we have different types of Map

TreeMap
HashMap
LinkedHashMap
Re: What's The Difference Between Hashmap And Objects by Tobedated(op): 9:42am On Nov 10, 2022
chukwuebuka65:
Just see objects as a group of variables that are related together with methods to work on them. That’s the foundation of object oriented programming . Hash maps are just like array but with named indexes. I think javascript objects acts like hash maps and also like objects ( in the real sense of objects ie a group of related variables and functions to manipulate them).

You can google objects in programming in general to understand more.
thanks that means i still got a lot to learn
Re: What's The Difference Between Hashmap And Objects by Tobedated(op): 9:44am On Nov 10, 2022
etoluw:
In OOP objects are not key/value pairs . It is JavaScript that give you that impression.

Any key/value pair is a Map. we have different types of Map

TreeMap
HashMap
LinkedHashMap
oh, okay thanks i still got a lot to learn
Re: What's The Difference Between Hashmap And Objects by Deicide: 4:52pm On Nov 10, 2022
Well in a HashMap your keys are unique. Except maybe you using a multimap data structure. This is one of the reason we ask people to start with Languages like C++ or Java, this is because this are Strongly and statically typed languages.
Re: What's The Difference Between Hashmap And Objects by tosinhtml: 7:23pm On Nov 10, 2022
TastyFriedPussy:
You'll later give up and I'll be here waiting for you when that eventually happens tongue rubbish..
grin grin grin grin You need deliverance!
Re: What's The Difference Between Hashmap And Objects by tensazangetsu20(m): 7:52pm On Nov 10, 2022
Deicide:
Well in a HashMap your keys are unique. Except maybe you using a multimap data structure. This is one of the reason we ask people to start with Languages like C++ or Java, this is because this are Strongly and statically typed languages.
You can't have double key types in a JavaScript object still.
Re: What's The Difference Between Hashmap And Objects by Karleb(m): 8:11pm On Nov 10, 2022
tensazangetsu20:
You can't have double key types in a JavaScript object still.
It's good to note that javascript has a map object, which works very similar to the hashmaps in Java for example.
Re: What's The Difference Between Hashmap And Objects by tensazangetsu20(m): 8:12pm On Nov 10, 2022
Karleb:
It's good to note that javascript has a map object, which works very similar to the hashmaps in Java for example.
Yeah ES6. Map and Sets
Re: What's The Difference Between Hashmap And Objects by 99thEnemy(m): 9:31pm On Nov 10, 2022
TastyFriedPussy:
You'll later give up and I'll be here waiting for you when that eventually happens tongue rubbish..
grin grin grin
Re: What's The Difference Between Hashmap And Objects by Deicide: 9:52pm On Nov 10, 2022
tensazangetsu20:
You can't have double key types in a JavaScript object still.
It would complain but allow it
Re: What's The Difference Between Hashmap And Objects by tensazangetsu20(m): 9:58pm On Nov 10, 2022
Deicide:
It would complain but allow it
It won't. It reassigns what you had on the previous key to the present.
Re: What's The Difference Between Hashmap And Objects by Deicide: 10:52pm On Nov 10, 2022
tensazangetsu20:
It won't. It reassigns what you had on the previous key to the present.
Hmm but that is not a good Idea it leaves room for error.
1 Reply

What Are Proxy Objects? And How They Work In JavascriptDifference Between Website Design, Front End And Back End DevelopmentWeb Development And Web Design - The Difference234

Converting Website Into Mobile AppI'm Facing A Challenge Trying To Land IT Support Roles. Please Help �Google Code Search