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

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

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 :: javascript search dictionary by value 
Javascript :: select all elements javascript 
Javascript :: jquery on click function 
Javascript :: find Array of value in JSON 
Javascript :: jquery on click fade out element 
Javascript :: sum all elements in array javascript 
Javascript :: make a get request in node js 
Javascript :: on function change body background image 
Javascript :: factorial in javascript 
Javascript :: javascript onsubmit 
Javascript :: js two array combining with id 
Javascript :: get combinations of two js 
Javascript :: js add to array conditionally 
Javascript :: dockerfile copy ignore node_modules 
Javascript :: how to detect a url change 
Javascript :: today date js 
Javascript :: get index of item array 
Javascript :: javascript ajax load html into div 
Javascript :: how to add two attay into object in javascript 
Javascript :: function js format money 
Javascript :: socket io close client connection 
Javascript :: js id generator 
Javascript :: disable a button in javascript 
Javascript :: how to trap js errors window.onerror 
Javascript :: lodash remove element from array 
Javascript :: search in string array javascript 
Javascript :: javascript on keypu 
Javascript :: js conditional object key 
Javascript :: dynamic style react 
Javascript :: javascript pluck 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =