More kinds of Methods/ squared?


#1



https://www.codecademy.com/en/courses/spencer-sandbox/2/7?curriculum_id=506324b3a7dffd00020bf661


is there a squared operator in javascript? Below is the answer and I'm curious about this line return this.sideLength * this.sideLength. Would the square be return this.sideLength ** 2


var square = new Object();
square.sideLength = 6;
square.calcPerimeter = function() {
  return this.sideLength * 4;
};
// help us define an area method here
square.calcArea = function(){
    return this.sideLength * this.sideLength;
    };

var p = square.calcPerimeter();
var a = square.calcArea();

#2

Yes there is. It's ^. Example: "4 ^ 2 = 16".
You could do this.sideLength ^ 2.


#3

thanks that cleared it up for me