I am attempting to print a string as a string literal in JavaScript, so that the string will be printed exactly as it is written:
printStringLiteral("\n\nHi!");//this prints "Hi!" instead of "\n\nHi!".
//What will I need to do in order to print
//the string as a string literal instead?
function printStringLiteral(toPrint){
console.log("\"" toPrint + "\"");
}
\nor\u000A)?