Repl (read eval print loop) is a very useful tool that allows us to runCodeThe result is displayed. Although this is not worth mentioning compared to the firebug console, it is useful when providing a demonstration in a personal blog.
Below is all its code, including HTML.
<Textarea style = "width: 100%" onkeyup = "this. rows = (function (t) {for (VAR I = 0, H = 1; I <t. length; I ++) if (T. charat (I) = '\ n') h ++; return H ;}) (this. value); "> // --------------------- this is an example ----- var now = new date; var pad = function (Num, digits, Radix, filling) {num = num. tostring (Radix | 10); filling = filling | "0"; while (Num. length<Textarea style = "width: 100%" onkeyup = "this. rows = (function (t) {for (VAR I = 0, H = 1; I <t. length; I ++) if (T. charat (I) = '\ n') h ++; return H ;}) (this. value); "> // --------------------- this is an example ----- var now = new date; var pad = function (Num, digits, Radix, filling) {num = num. tostring (Radix | 10); filling = filling | "0"; while (Num. length <input type = "button" value = "eval" onclick = "try {var o = This. nextsibling. nextsibling; var P = function (s) {var E = document. createelement ('P'); E. appendchild (document. createtextnode (s); E. style. margin = 0; O. appendchild (e) ;}; (new function ('P', this. previussibling. value) (p);} catch (e) {alert (e)} "> <input type =" button "value =" clear "onclick =" this. nextsibling. innerhtml = ''"> </textarea>