how does nodejs brush out all the Chinese in the text? Extract all Chinese from a html page or js text (retain any characters between the characters and remove all annotated text) and put it into another text?
// var getId = function(id) {
// return document.getElementById(id)
// }
/*!!*/
document.getElementById = (function (func) {
return function () {
return func.apply(document, arguments)
}
})(document.getElementById)
var getId = document.getElementById;
console.log(getId("div1"))
/* var func = function(a, b, c) {
"use strict";
console.log(this)
console.log(this === window)
}
func.apply(null, [1,2,3])*/
/* document.getElementById("div1").onclick = function() {
var func =function() {
console.log(this.id)
}
func.call(this)
}*/
Function.prototype.bind = function (context) {
/* var self = this;
return function() {
return self.apply(context, arguments)
}*/
var self = this,
context = [].shift.call(arguments), //
args = [].slice.call(arguments); //
console.log(context, arguments, args)
return function () {
//
return self.apply(context, [].concat.call(args, [].slice.call(arguments)))
}
}
var obj = {
name: "sven"
}
var func = function (a, b, c, d) {
console.log(this.name)
console.log([a, b, c, d])
}.bind(obj, 1, 2)
func(3, 4)
/**
*
*
* @param {*} [params=[]]
*/
function HelloWord(params = []) {
console.log(":", ...params)
}
</script>
</body>
</html>