Raw strings in JavaScript are used to access the raw string literals from template literals without escaping special characters like
or
.
Example:
let rawStr = String.raw`Hello
World`;
console.log(rawStr); // Output: Hello\nWorld
Tags: advanced, JavaScript, Strings
URL: https://www.tiktok.com/@jsmentoring/photo/7471026585861164310