#Queries regarding Javascript coding.

8 messages · Page 1 of 1 (latest)

errant harness
#

Of course getEta is inaccesible. It's inside the onStart(), while you're expecting the variable eta_start to access getEta(T_start), while the getEta(T_start) is inside the onStart().

And also, idk what's the point of the onStart() function. So, I simply make the getEta(T) function, into global scope.

// REMOVED: function onStart() { 
// Function declaration
function getEta(T) {
    const eta = -4.800122e-21 * Math.pow(T, 6) + 7.498400e-18 * Math.pow(T, 5) - 4.773811e-15 * Math.pow(T, 4) + 1.614263e-12 * Math.pow(T, 3) - 3.265875e-10 * Math.pow(T, 2) + 6.246720e-8 * T - 4.662013e-8;
    return eta;
}

// Usage
const T_start = 50;
const T = T_start;
const eta_start = getEta(T_start); // This should be accesible.
#

Innoslate

#

But im using online web Innoslate

#

No

#

Ok,Ill try

#

Thanks

errant harness
#

That's not the script's error. Listen to what @errant harness said, use a Dev console. Here's the result, no error.

#

Yes, thanks a lot. I checked on other developer app also, its working. Maybe Innoslate problem. Thanksn again for your valuable suggestion and time.