Some good improvements to make things more DRY, but the nested ternary's make my brain bleed. I feel like this would be much more legible using a switch or even just if/else statements.
I'm a full-stack developer who loves to write about software programming and technology in general. Need a freelancer or want to collaborate? Send an email to my address below.
Thanks for sharing King.
You can concise this code a bit further and avoid repeating the same strings or values using temporals in Javascript.
Here is my version:
jsfiddle.net/iStealersn/12uetjgv/4/
Some good improvements to make things more DRY, but the nested ternary's make my brain bleed. I feel like this would be much more legible using a switch or even just if/else statements.
Yeah I agree, had the same feeling after completion. If/Else statements make it look long while switch may definitely help gotta give a shot
If you have an improved version please share, it will be helpful
Awesome!
Thanks for sharing