Refer to the attached image. Since one vertex is the origin and the other two lay on the coordinate axes, the triangle is a right triangle. This means that, if we consider AB to the be base, AC is his height, and vice versa.
Anyway, it means that the area is given by
[tex] A = \cfrac{\overline{AB}\times\overline{AC}}{2} [/tex]
Since AB is a horizontal segment and AC is a vertical segment, their length is given by the absolute difference of the non-constant coordinate: points A and B share the same x coordinate, so we subtract the y coordinates:
[tex] \overline{AB} = |2-0| = |2| = 2 [/tex]
The opposite goes for AC: points A and C share the same y coordinate, so we subtract the x coordinates:
[tex] \overline{AC} = |4-0| = |4| = 4 [/tex]
So, the area is
[tex] A = \cfrac{2\times 4}{2} = 4[/tex]