window.onerror = function(msg,url,l){ txt="There was an error on this page.\n\n" txt+="Error: " + msg + "\n" txt+="URL: " + url + "\n" txt+="Line: " + l + "\n\n" txt+="Click OK to continue.\n\n" console.log(txt); returntrue };
functiongetByteLength(str) { var result = ""; var flag = false; var len = 0; var length = 0; var length2 = 0; for (var i = 0; i < str.length; i++) { var code = str.codePointAt(i).toString(16); if (code.length > 4) { i++; if ((i + 1) < str.length) { flag = str.codePointAt(i + 1).toString(16) == "200d"; } }
if (flag) { len += getByteByHex(code); if (i == str.length - 1) { length += len; } } else { if (len != 0) { length += len; length += getByteByHex(code); len = 0; continue; } length += getByteByHex(code); } } return length; }
You have a list with website URLs with some mistakes — capital letters. Print the number of the list elements, fix the mistakes in each element of this list, make a map with the domains as key and the length of the respective URLs as value. Try to do it within the body of a proper scope function. Note: Don’t print the whole map, only return it.
es6-promise 27.86 KB (7.33 KB gzipped)es6-promise-auto 27.78 KB (7.3 KB gzipped) - Automatically provides/replaces Promise if missing or broken. es6-promise-min 6.17 KB (2.4 KB gzipped)es6-promise-auto-min 6.19 KB (2.4 KB gzipped) - Minified version of es6-promise-auto above.
CDN
1 2 3 4 5 6 7
<!-- Automatically provides/replaces `Promise` if missing or broken. --> <scriptsrc="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.js"></script> <scriptsrc="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.js"></script>
<!-- Minified version of `es6-promise-auto` below. --> <scriptsrc="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.min.js"></script> <scriptsrc="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js"></script>
* About to connect() to api.gowhich.com port 443 (#1) * Trying 10.252.117.104... * Connected to api.gowhich.com (10.252.117.104) port 443 (#1) * Initializing NSS with certpath: sql:/etc/pki/nssdb * Unable to initialize NSS database * Initializing NSS with certpath: none * Unable to initialize NSS * Closing connection 1
错误信息2
1 2 3 4 5 6
* Initializing NSS with certpath: none * NSS error -5978 (PR_NOT_CONNECTED_ERROR) * Network file descriptor is not connected * Closing connection 0 int(35) Network file descriptor is not connected