Is there an advantage one over the other? In my current project, using the index with the dot is questioned as bad practice, requesting to always use the index() function, my question is, is this really necessary? what are the reasons? I understand that sometimes it is good to control the default value and set a null.
Discussion posts and replies are publicly visible
There is one very important difference. index() or property() return a copy of the data while dot-notation or square-bracket-notation return a reference to the original data. Knowing this is crucial for using more complex data structures in saveInto where index()/property() will not work.
Stefan Helzle Thanks for adding a closure note with a very important point.