I am looking for an alternative api in javascript for the StringEscapeUtils in java.
Basically it should be able to convert
input string:
He didn't say, "Stop!"
output string:
He didn't say, \"Stop!\"
Can we do the same using any underscore or any other util functions?
In underscore`s escape api,
var a = '"test"'; _.escape(a)
returns
""test""
But I wanted in the format \"test\"'