I'm trying to work through the
AngularJS v1.2 tutorial. The task is to:
Add a method to GalleryController called setCurrent that accepts a value and assigns it to current. If no value is passed in, set current to 0.
The pertinent code in app.js
Here's the index.html that uses that GalleryController
I don't understand how || works on line 8. According to the MDN docs for
Logical Operators I think this should set this.current to false if nothing is passed into it. I am confused. Can someone help me? Thanks.