[{"title":"Inception","rating":"8.8"},{"title":"Interstellar","rating":"8.6"},{"title":"The Dark Knight","rating":"9.0"},{"title":"Batman Begins","rating":"8.3"},{"title":"Avatar","rating":"7.9"}]
Here is what I did so far,
["{title : Inception,rating : 8.8}","{title : Interstellar,rating : 8.6}","{title : The Dark Knight,rating : 9.0}","{title : Batman Begins,rating : 8.3}","{title : Avatar,rating : 7.9}"]
suggestion: make your code readable using appropriately named variables. Here using the name of user does not make sense, it is not related to what each array element rapresents in any way
You’re close, but I’m not sure I understand this syntax here? This says ‘look for the value of property of obj that has the key corresponding to the contents of movie.Title’.
Do you need the obj[] part? What is your intent with that part?
This isn’t how you assign properties to new objects. You are trying to assign the poperty to itself, which is impossible. I’d echo @ILM and say you need to review how objects work, you’re fundamentally misunderstanding some things here.
The object you are accessing is movie in the function, the parameter of the callback is the object.
Edit: yes, that’s how you do it. Do you understand fully what you’ve written here, why the previous attempts were incorrect?
Ya, I understand. movie.Title is movie name. obj[movie.Title] doesn’t make any sense. As @JeremyLT said, This says 'look for the value of property of obj that has the key corresponding to the contents of movie.Title '.