You may also use Math.pow(x,2) this means x power 2.