Reference log()

log()

Prints a message to your browser's web console. When using p5, you can use print and console.log interchangeably.

The console is opened differently depending on which browser you are using. Here are links on how to open the console in Firefox , Chrome, Edge, and Safari. With the online p5 editor the console is embedded directly in the page underneath the code editor.

From the MDN entry: The Console method log() outputs a message to the web console. The message may be a single string (with optional substitution values), or it may be any one or more JavaScript objects.

Examples

Syntax

log(message)

Parameters

message

:Message that you would like to print to the console

Notice any errors or typos? Please let us know. Please feel free to edit src/core/reference.js and open a pull request!

Related References