Inside the console, you can simply declare variables and use them.
var x = 'thing';
undefined
x + 3;
'thing3'
I want set that variable from a Javascript file, and use it in the console. That does not seem possible, so I hope somebody knows a solution for it.
In a javascript file, typing console.log(var x = 'thing')
gives compilation errors in Gulp. I know I can just type console.log(x)
, but I want to use the variable and play with it in the console.
How can I declare variables that I can use in the console?