Yes, JavaScript has “short-circuit” evaluation.
if (true == true || foo.foo){
// Passes, no errors because foo isn't defined.
}
if (false && foo.foo){
// Passes, no errors because foo isn't defined.
}
More Related Contents:
- Using &&’s short-circuiting as an if statement?
- Generate PDF from HTML using pdfMake in Angularjs
- Limited parallelism with async/await in Typescript/ES7
- valueOf() vs. toString() in Javascript
- Angular 4 Interceptor retry requests after token refresh
- In Angular, how do you determine the active route?
- Copy to clipboard using Javascript in iOS
- Is there an easy way to reload css without reloading the page?
- Typescript – Extending Error class
- How can val() return Number?
- Leaflet map not displayed properly inside tabbed panel
- window.focus(), self.focus() not working in firefox
- Can javascript access iframe elements from the parent page?
- Get a polyline from Google maps directions V3
- Showing alert in angularjs when user leaves a page
- How to run html file on localhost?
- Handling Asynchronous Calls (Firebase) in functions
- Using Matter.js to render to the DOM or React
- How to set _id to db document in Mongoose?
- Array.includes() to find object in array
- Javascript RegExp for splitting text into sentences and keeping the delimiter
- How to download PDF automatically using js?
- How to use Array.prototype.filter with async?
- How to add validation/restrictions for HTML5 date field without jquery/javascript
- What is client side javascript and what is server side javascript?
- Prevent iOS bounce without disabling scroll ability
- Creating an array consisting of the largest values of each sub-array does not work as expected
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
- Jquery: Filter dropdown list as you type [closed]
- Removing element with jQuery?