I do at runtime so that I get the value from the function:
var dis = function calcD(a, b, c) { return b*b - 4*a*c; }; dis = dis(-4, 2, 1); Then you can simply call dis , which will have a specific value.
So, how can you immediately force the calcD script to execute and shove it into a variable without an additional line dis = dis(-4, 2, 1); ?