Skip to main content

console.log(...data)

Shows the passed data as formatted representations on the screen. Data arguments will be separated by line breaks.

Status: unstable
Returns: void

Parameters

NameTypeDescription
data...anyThe data to be displayed on the screen

Example usage

console.log("a", "b", "c");

Extra behaviors

ConditionConsequenceWorkaround
Passing a function or Error object as argumentAn internal TargetInvocationException will be thrown and the method will not proceed to the next argumentsCall the function with [object].toString() instead of passing directly
Passing common instance objects as arguments (like Promise, Set or Map)The output will be {}Try converting the instance values to an object or getting the values to be shown directly
Trying to visualize object methods with console.logCurrently, console.log can't reproduce a map of the internal methods of an objectTo visualize the method itself try referencing it directly
Passing interoperability methods from the internal .NET CLRThe output will be function () { [native code] }There is no workaround since .NET methods are not supposed to be stringified/shown by console.log