power method

num power(
  1. num exponent
)

Raises the current number to the power of exponent.

Example:

print(2.power(3)); // Outputs: 8 (2^3)

Implementation

num power(num exponent) => pow(this, exponent).toInt();