number square n times in typescript code example
Example: number square n times in typescript
Math.pow(x1, 2)
x1 * x1
x1 ** 2 // ES6 syntax
function square(firstNumber: number, secondNumber: number):number{
return firstNumber ** secondNumber
}
// For example
console.log(square(4,2))
//output.:
16