Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #number #square #times #typescript
ADD COMMENT
Topic
Name
4+6 =