DEV Community

Discussion on: #100daysofcode [ Day - 01 ]

Collapse
 
rbravo86 profile image
Richard Bravo

Well done, another option would be :

(( number % 2 != 0 ) ? "This is a Odd number :)" : "this is a even number :)")

Good luck with #100daysofcode :) Gotta have guts, be brave!

I'm looking forward to see your progress.

Collapse
 
briannarenni profile image
Brianna Renni

Want to clarify in case OP doesn’t know: this refactoring is using the ternary operator :)

(Condition) ? CodeIfTrue : CodeIfFalse

Collapse
 
alsiam profile image
Saif Al Siam

Thank you for your suggestions bro. I will definitely try it next time.

Thread Thread
 
briannarenni profile image
Brianna Renni

No problem, I was where you were not long ago, it feels good to be able to understand a concept enough to pass it on!

It also takes the stress from If Statements haha

Thread Thread
 
alsiam profile image
Saif Al Siam

yes bro! 😊

Collapse
 
alsiam profile image
Saif Al Siam

It's a great pleasure to talk with you . And thank you for giving suggestions to code in standard way. I think your code is more standard and more professional. thank so much bro . I will definitely try it now .