Non-stringifiable to Default: returns tagged template function that replaces any expression that has no toString property with a default value.
toString
const value = n2d('default')`string: ${'foo'} number: ${42} boolean: ${true} null: ${null} undefined: ${undefined}`;// value === 'string: foo number: 42 boolean: true null: default undefined: default' Copy
const value = n2d('default')`string: ${'foo'} number: ${42} boolean: ${true} null: ${null} undefined: ${undefined}`;// value === 'string: foo number: 42 boolean: true null: default undefined: default'
The default value.
Tagged template function that replaces any expression that has no toString property with default.
default
Rest
Non-stringifiable to Default: returns tagged template function that replaces any expression that has no
toString
property with a default value.Example