Some Non-stringifiable to Null: returns null when any expression has no toString property.

const value = sn2n`string: ${'foo'} number: ${42} boolean: ${true} null: ${null} undefined: ${undefined}`;
// value === null
  • Parameters

    • strings: TemplateStringsArray

      The string literals.

    • Rest...exp: unknown[]

      The expressions.

    Returns unknown

    The output string.