Skip to main content

toString

Returns a string representation of the node. For debugging purposes only, do not rely on the exact output of this string in production code.

Signature

toString(): string

Remarks

This currently returns a string of the form [Node ID] where ID is the id of the node. This is just for debugging convenience so the node displays something useful when converted to a string. We recommend not relying on this in production.

Example:

// e.g. [Node 0:5]
console.log(`Current selected node ${figma.currentPage.selection[0]}`)

On this page