I’m trying to teach myself JavaScript. I want to be able to reference a line of code so the system can identify it and register it.
console.log(a * w_discount - a * tax - a)
How do I link the answer of this up to do further coding with it?
I’m trying to teach myself JavaScript. I want to be able to reference a line of code so the system can identify it and register it.
console.log(a * w_discount - a * tax - a)
How do I link the answer of this up to do further coding with it?
try use following code which write stack-trace on console (but look on chrome console not snippet) (you can also use error
instead warn
)
console.warn('xx');
function test() {
console.warn('xx');
}
test();
Store the expression in a variable as such:
var x_variable = (a * w_discount - a * tax - a)
Then reference it anywhere else.
console.log(x_variable)
You can name the variable anything you want.