functiontest() { // 这里就是 a =1 console.log(a); // 然后再赋值 var a = 1; }
test();
这里的变量a进行了提升,先定义(!把定义提升!)后(!在其赋值位置!)赋值,如果不存在 var 就不会提升,接着就是未定义报错。而函数表达式(function t(){} )会提升最高,如果用 var t = function (){} 的形式则根据变量原则提升。而在 ES6 中使用 let 和 const 不存在提升。
1 2 3 4 5 6 7 8 9 10 11
functiontest() { console.log(1); }
test();
var test = function() { console.log(2); };
test();
这里就会输出 1 和 2。
1 2 3 4 5 6 7 8
var a =20; functiont1(){ console.log(a) } (functiont2() { var a = 10; t1() })()
1 2 3 4 5 6 7 8 9
var scope = "global scope"; functioncheckscope(){ var scope = "local scope"; functionf(){ return scope; } returnf(); } checkscope();
1 2 3 4 5 6 7 8 9
var scope = "global scope"; functioncheckscope(){ var scope = "local scope"; functionf(){ return scope; } return f; } checkscope()();
环境为 Ubuntu Server 16.04 和 Nginx,具体可参考官网,letsencrypt是certbot以前的名称,github的地址也重定向到certbot了。
Certbot, previously the Let’s Encrypt Client, is EFF’s tool to obtain certs from Let’s Encrypt, and (optionally) auto-enable HTTPS on your server. It can also act as a client for any other CA that uses the ACME protocol.
WARNING: unable to check for updates. Creating virtual environment... Traceback (most recent call last): File "/usr/lib/python3/dist-packages/virtualenv.py", line 2363, in <module> main() File "/usr/lib/python3/dist-packages/virtualenv.py", line 719, in main symlink=options.symlink) File "/usr/lib/python3/dist-packages/virtualenv.py", line 988, in create_environment download=download, File "/usr/lib/python3/dist-packages/virtualenv.py", line 918, in install_wheel call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT) File "/usr/lib/python3/dist-packages/virtualenv.py", line 812, in call_subprocess % (cmd_desc, proc.returncode)) OSError: Command /root/.local/share/letsencrypt/bin/python2.7 - setuptools pkg_resources pip wheel failed with error code 2
const lorem = 'Lorem ipsum dolor sit amet, consectetur\n\t' + 'adipisicing elit, sed do eiusmod tempor incididunt\n\t' + 'ut labore et dolore magna aliqua. Ut enim ad minim\n\t' + 'veniam, quis nostrud exercitation ullamco laboris\n\t' + 'nisi ut aliquip ex ea commodo consequat. Duis aute\n\t' + 'irure dolor in reprehenderit in voluptate velit esse.\n\t'
使用反引号,则可以达到简写作用:
1 2 3 4 5 6
const lorem = `Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse.`
ssh-keygen -t rsa # 一直回车默认即可 Generating public/private rsa key pair. # Key存放路径 Enter file in which to save the key (/lishude/.ssh/id_rsa): # 输入密码短语(留空则直接回车) Enter passphrase (empty for no passphrase): # 重复密码短语 Enter same passphrase again: Your identification has been saved in /lishude/.ssh/id_rsa. Your public key has been saved in /lishude/.ssh/id_rsa.pub. The key fingerprint is: blah...