The | operator is the bitwise or operator.
The | operator lines up the binary digits of each operand, and returns 1 for that place if there is a 1 in that place either or both of the operands.
For example, let's look at what 3 | 10 does:
3 is 11 in binary.
10 is 1010 in binary.
Line them up, and you get
3 - 0011
10 - 1010
Result - 1011
The result 1011 is 11 in decimal, so the result of this example is 11.
Here's one of the examples in your question 4 | 2 | 4 | 1 | 10
4 - 0100
2 - 0010
4 - 0100
1 - 0001
10 - 1010
| ======
1111
And 1111 is binary for 15, which was the result you got.
The bitwise or operator, along with other bit manipulation operators are generally used for low-level computations. For example, you can implement arithmetic like multiplication, addition, and division entirely with bitwise operators.