Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js pow

Math.pow(base, exponent);

Math.pow(2, 4);
// Outputs 16
// The same as going 2^4, 2 to the power of 4
Comment

Math.pow

Math.pow(base, exponent);

Math.pow(2, 4);
Comment

define math.pow() method in javascript

// Math.pow()

// The Math. pow() method returns the value of x to the power of y (xy).

// EXAMPLE : 1
let powerOf = Math.pow(2,5);
console.log(powerOf);
// OUTPUT: 32

// EXAMPLE : 2
let powerOf2 = Math.pow(-2,5);
console.log(powerOf2);
// OUTPUT: -32

// EXAMPLE : 3
let powerOf3 = Math.pow();
console.log(powerOf3);
// OUTPUT: NaN
Comment

Math.pow

import java.lang.*;

public class MathDemo {

   public static void main(String[] args) {

//what is Math.pow(3, 2)?

      double x = 3;
      double y = 2;

      System.out.println("Math.pow(" + x + "," + y + ")=" + Math.pow(x, y));
   }
}

//the Output is 9
Comment

js pow function

var x = parseInt(prompt("Enter the base: "))
var y = parseInt(prompt("Enter the power: "))

var value = parseInt(Math.pow(x, y))

console.log(value)
Comment

javaScript Math.pow()

Math.pow(8, 2);
Comment

PREVIOUS NEXT
Code Example
Javascript :: convert long date to short date javascript 
Javascript :: jest expect error type 
Javascript :: on click jquery 
Javascript :: cdn react 
Javascript :: semantics ui complete responsive menu 
Javascript :: copy to clipboard javascript dom 
Javascript :: adonis hasone 
Javascript :: first and last char vowel reg exp same char 
Javascript :: Factorial multiplication in javascript 
Javascript :: remove duplicates from array js 
Javascript :: jquery serialize with file upload 
Javascript :: angular for loop 
Javascript :: html2canvas angular 
Javascript :: javascript remove single class from element 
Javascript :: append HTML elements in JavaScript 
Javascript :: today date javascript 
Javascript :: useeffect with cleanup 
Javascript :: wordpress ajax file upload 
Javascript :: create array with number js 
Javascript :: replace class js 
Javascript :: js convert array of array to array 
Javascript :: document onload 
Javascript :: Package path ./compat is not exported from 
Javascript :: python range in javascript 
Javascript :: button disabled javascript 
Javascript :: javascript sort array of objects by key value 
Javascript :: word to char array javascript 
Javascript :: format date js 
Javascript :: jquery set inner text 
Javascript :: next js material ui typescript 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =