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.
Supported On:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- DocumentNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PageNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- VectorNode
- WashiTapeNode
- WidgetNode
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]}`)