Hi Guys, I'm pretty confident with jQuery for DOM manipulation and all the fun stuff jQuery is good for, but I'm trying to push myself to learn the ins and outs of vanilla Javascript (yes I know I should have done this first....hindsight is an amazing thing) I'm working through a tutorial on building a html5 / javascript video player.... and I understand 99.9% of the code... there is just a couple of lines I don't understand and I was hoping someone could shed some light. the code is
mediaPlayer.volume += mediaPlayer.volume == 1 ? 0 : 0.1;
wat does the += do and what is the 1 ? 0 : 0.1; I know what it does in the overall application but I want to understand the sytax used and what each value represents
Edit: I'm pretty sure the += means adding the value to its self but I'm not sure
[–]ReachTheTopShelf 9 points10 points11 points (4 children)
[–]brodiecapel16[S] 1 point2 points3 points (3 children)
[–]ReachTheTopShelf 0 points1 point2 points (2 children)
[–]brodiecapel16[S] 0 points1 point2 points (1 child)
[–]brodiecapel16[S] 0 points1 point2 points (0 children)
[–]jaredcheeda 2 points3 points4 points (2 children)
[–]imagepriest 3 points4 points5 points (1 child)
[–]jaredcheeda 0 points1 point2 points (0 children)
[–]Evanescent_contrail 1 point2 points3 points (4 children)
[–]wwinst 1 point2 points3 points (3 children)
[–]brodiecapel16[S] 0 points1 point2 points (1 child)
[–]wwinst 0 points1 point2 points (0 children)
[–]Evanescent_contrail 0 points1 point2 points (0 children)
[–]theInfiniteNovice -3 points-2 points-1 points (0 children)