I liked the way you explained in the concept in a simple and easy to understand way, while also relating it practically with real life scenario. Keep writing more Stephen. 🙂
Are there ways to utilize the short-circuiting or are they merely optimization? Put another way, is short-circuiting's behavior only useful for just directly skipping the unnecessary check, or does/can it have other benefits or uses?
In most instances it’s a performance optimisation, but there are instances when you can use it for other reasons. This is normally when the operation has side-effects (say a function that modifies an object) and you only want that operation to occur for objects until you find your first truthy or falsy value
Loved the plane analogy Stephen! I learned how to use the any built-in function perfectly! 🙌🏻
Thanks Josep…
I liked the way you explained in the concept in a simple and easy to understand way, while also relating it practically with real life scenario. Keep writing more Stephen. 🙂
Thanks Praveen. I’ll definitely try to keep on writing!
Are there ways to utilize the short-circuiting or are they merely optimization? Put another way, is short-circuiting's behavior only useful for just directly skipping the unnecessary check, or does/can it have other benefits or uses?
In most instances it’s a performance optimisation, but there are instances when you can use it for other reasons. This is normally when the operation has side-effects (say a function that modifies an object) and you only want that operation to occur for objects until you find your first truthy or falsy value