encode string in javascript code example
Example 1: javascript html special characters
return mystring.replace(/&/g, "&").replace(/>/g, ">").replace(/</g, "<").replace(/"/g, """);
Example 2: jq unencode string
# -r enable raw output
jq -r .[0].string FILE.json