Back to Core Js

String.dedent

docs/web/docs/features/proposals/string-dedent.md

3.49.0802 B
Original Source

String.dedent

Specification
Proposal repo

Modules

esnext.string.dedent

Built-ins signatures

ts
class String {
  static dedent(templateOrTag: { raw: Array<string> } | function, ...substitutions: Array<string>): string | function;
}

Entry points

plaintext
core-js/proposals/string-dedent
core-js(-pure)/full/string/dedent

Example

js
const message = 42;

console.log(String.dedent`
  print('${ message }')
`); // => print('42')

String.dedent(console.log)`
  print('${ message }')
`; // => ["print('", "')", raw: Array(2)], 42