What are the actual uses of ES6 Raw String Access?
问题 What are the actual uses of String.raw Raw String Access introduced in ECMAScript 6? // String.raw(callSite, ...substitutions) function quux (strings, ...values) { strings[0] === "foo\n" strings[1] === "bar" strings.raw[0] === "foo\\n" strings.raw[1] === "bar" values[0] === 42 } quux `foo\n${ 42 }bar` String.raw `foo\n${ 42 }bar` === "foo\\n42bar" I went through the below docs. http://es6-features.org/#RawStringAccess https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template