How can I print a message to the error console, preferably including a variable?
For example, something like:
print(\'x=%d\', x);
To actually answer the question:
console.error('An error occurred!'); console.error('An error occurred! ', 'My variable = ', myVar); console.error('An error occurred! ' + 'My variable = ' + myVar);
Instead of error, you can also use info, log or warn.