we use conditions everywhere on our applications whether for state check or rendering some data into the view depending on some parameters. in this...
For further actions, you may consider blocking this person and/or reporting abuse
Just one simple piece of advice: Instead of using 4 spaces for indentation in code snippets for blogs, I think it's better to use 2 spaces as it reduces the need for horizontal scrolling.
Great read. 👌
thanks for this advice 🤍
github.com/gvergnaud/ts-pattern
this is also a good alternative
will try it thanks 💕
As always, all gold is in comments :)
I think this is not a matter of condition. It's a matter of good practice. Example 1 is easy to understand for beginners, but the other one is good to maintain and easy to extend.
it's a better way to write conditions as you said easy to maintain , extend and debug
This is great!
You get to simplify things further by creating objects with properties that point to specific values instead of checking nonstop for multiple values.
that's exactly it
this is awesome
you are awesome
didn't expect that anyone would see this post
Really Great Approach, Surely i am going to use in my Project, Awsome Thanks!
that's awesome, have a good one
Thank you 🙏
You're welcome 💕
There is nothing wrong with conditions, you just reshaped the data you are working with
exactly, there is nothing wrong with conditions anyways , it's just a better approach
Amazing tip!
thanks <3
Thank you for posting, I am aspiring to be able to write and understand fluently! Reading these articles from inside perspectives helps tremendously!
glad to hear that 🤍
Well executed!
thanks 🤍
You are doing great
thanks 💕
Nice one!!!
thanks :)
thanks 👌
you are welcome 😌🤍
Brilliant <3
thanks 🤍
very understandable.
thanks 🤍🔥
Nice code
thanks 🤍
Well explained!
thanks 🤍
Nice explanation.
thanks 🤍
great
thanks ♥️
Nice. Thank you for this
thanks 🤍😌
I like this.
thanks 🤍
Greate!!!!!
thanks 😌
Nice
thanks 🤍
Perfect explanation!!!
simple way to do clean code :)
happy to hear that 💕