Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 825 Bytes

File metadata and controls

13 lines (10 loc) · 825 Bytes

Difference between map and struct

  • map -> map is simply a data structure which it stores key-value pair, types are strict here, no nesting here
  • struct -> user defined data structure where you have freedom to define your data with diff types easily used almost everywhere in production, nested properties

When to use map vs struct

  • when you are not aware of types properly and does't matter really you can use map otherwise you have to use struct

What is ok in map access?

  • i guess its a boolean value which returns true or false wheather this key exists or not

Why structs are important in backend

  • when you working on real backend system struct are beast for that like first of all you know what data you have defined of what type really accurate and you have clean formatt too