Superscript in code


#1

Hello, i just want to ask how to assign a superscript text in a variable. Im trying to use .sup() method of javascript but it displays literally '<sup>2</sup>'.

i want to do something like this. But it wont work.

togchangeax(){
    if (this.axis==true){
      this.formula = '(x-h)'+'2'.sup()+' = 4c(y-k)';
    }else{
      this.formula = '(y-k)'+'2'.sup()+' = 4c(x-h)';
    }
  }

Thanks in advance.