字符串反转 String.prototype.reverse = function() { var a = this.split(''); for (var i = 0, j = a.length-1; i < j; i++, j--) { var tmp = a[i]; a[i] = a[j]; a[j] = tmp; } return a.join(''); } // test var s = "Hello world!"; console.log(s.reverse());…
var dynamicLoading = { css: function(path){ if(!path || path.length === 0){ throw new Error('argument "path" is required !'); } var head = document.getElementsByTagName('head')[0]; var link = document.createElement('link'); link.href = path; lin…