I am completely new to programming. I got a programming book for Christmas and since then I have been following the JavaScript book.

I dont understand how the ternary (or conditional) operator works.
in the following example I know that if x is greater than 0 it runs the code but what does x:-x do?

```
                          x > 0 ? x : -x

```