dbg

Extension containing debug utilities

describe

Describes a value, prints the result to stdout and returns the value.

Output will contain:

  • Type ('string', 'array', 'object', 'number', etc)

  • Value (concatenated to 32 chars)

  • Length (if applicable)

  • If value is an array (when type is 'object')

  • If value is JSON (when type is 'string')

  • JSON-type (when parsed)

  • JSON-length (when parsed)

Syntax

dbg.describe(value[, label])

Arguments

Name
Type
Description

value

any

The value to describe.

Example

dbg.describe('this is a string', 'string')

// Will output:
--- Describing: string ---
Type: string
Value: this is a string
Length: 16
JSON? no

Last updated