Of course, the author left us a small exercise because he only uses two characters, resulting in 8 times the converted data. He provides us with four zero-width characters, and we can reduce it to 4 times. Okay. Let's take a look at the code. Text (function (window) {var rep = {// Replace the data with four zero-width characters, reducing the data size by half. '00': '\ u200b', '01':' \ u200c ', '10':' \ u200d ', '11':' \ ufeff '}; function hide (str) {str = str. replace (/[^ \ x00-\ xff]/g, function (a) {// transcode a character other than Latin-1 encoding. Return escape (). replace ('%', '\') ;}); str = str. replace (/[\ s \ S]/g, function (a) {// process binary data and replace a =. charCodeAt (). toString (2); a =. length <8? Array (9-. length ). join ('0') + a: a; return. replace (/.. /g, function (a) {return rep [a];}) ;}); return str ;}var tpl = '("@ code ". replace (/. {4}/g, function (a) {var rep = {"\ u200b": "00", "\ u200c": "01", "\ u200d ": "10", "\ uFEFF": "11"}; return String. fromCharCode (parseInt (. replace (/. /g, function (a) {return rep [a]}), 2)}) '; window. hider = function (code, type) {var str = hide (code); // generates a string with Zero Width str = tpl. r Eplace ('@ Code', str); // generate the template if (type = 'eval') {str = 'eval' + str ;} else {str = 'function' + str + '()';} return str ;}}) (window); To test the effect. (Click Run in the upper-right corner of the code box.) Run var code = hider ('alert (") to test the text .. ") '); Console. log (code); then try the generated data. (If the previous step is not executed, an error is returned when you execute it directly .) Run eval (code) in text );