function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jie GouJie Gou 

javascript in lighting components controller

Hi, 

I am trying to add some logic into lighting component controller, in my understanding, it is javascript, so any old-school javascript should work ? Below is my code which does not work : 

calculateC : function(component, event, helper) {
  var myC = component.get("v.celsius");
       

        var newF = myC*9/5+32;
       
     component.set("v.fahrenheit", newF);           

        if (typeof my !== "number"){
            component.set("v.fahrenheit", 32);
        }
       
},

the part does not work is the typeof 
methymmethym
Is it just a typo where the following

if (typeof my !== "number"){

should be

if (typeof myC !== "number"){
?