100 likes
·
1.0K reads
26 comments
Wonderful article.
The optional chaining with function calls stood out for me.
Thanks a lot for sharing.
Suggestions:
In the example
let nestedProp = user.firstName?.lastName;
IMO I feel lastName
cannot be gotten from firstName
.
The example can be much clearer with user.names.lastName
instead to make the example much realistic.
Overall I enjoyed every bit of the article 😊
Thank you for the kind words, Samuel. Appreciate the suggestion. 😊
What I feel is :
Here it'll implicitly check to be sure user.firstName is not null or undefined before attempting to access user.firstName.lastName. If user.firstName is null or undefined, the expression automatically short-circuits, returning undefined.
Sure, I'm aware of the logic Insha Ramin
But talking about the user object structure.
This means you're saying the user structure is 👇
const user = {
firstName: {
lastName: "Insha"
}
}
What I'm saying 👇
const user = {
names: {
firstName: "Insha",
lastName: "Ramin"
}
}
So we can check if the name object exist before accessing the firstName or lastName.
I mean your lastName cannot be inside your firstName 😬.
I hope this explains the structure I'm talking about.
Got your point. Ayodele Samuel Adebayo
I guess this got a little bit confusing but the case wasn't this. Anyways I appreciate you taking out the time to highlight this.😄
This is the best explanation, I've ever seen on this topic. Keep up the good work Ina. 😁😁😁
Thank you, Ronnie. 😊🔥
Best explanation ⚡⚡on this Topic , well done 👏
Thank you for reading, Sintu. Glad to hear it was a great read for you 😃
Its quite detail explained Insha Ramin
Thanks for sharing 🔥
Thank you Suprabha Supi. Glad you liked the article! 😊💙
Thanks for putting this. Loved the article and the way you explained the concept 🔥👏
Ah, glad to hear this. Thank you for reading😊⚡
I like detailed explanation. Well done, Insha Ramin
Thank you, Faheem. 🤗
Great read Insha 🔥
Thank you so much, Olo🔥🤗
Good one Insha Ramin, detailed explanation. I love using it now a lot.
Thank you so much for reading the article. Glad you liked it 🤗
Great read, Detailed explanation 🔥🔥🔥
Thank you, Krishna💙
Thank you for this detailed explanation Insha, great work😃
Thank you, Deeksha! Glad you found it helpful💙
Well explained. Thank you!!
Glad to hear that, Kritika 😊
Amazingly explained ✌️💥
Wow insha,
Really like your blog, keep writing
Waiting for next 🙌👍😃