1. Node 安装

REPL:Loop(Print(Eval(Read))) 交互式代码运行终端

2. javascript 概览

  1. call 和apply

    改变this 的值,call 接收参数列表,apply接收参数数组

  1. function a(b,c){
  2. console.log('this',this); // {a:'aaa'}
  3. console.log('b', b); // bb
  4. console.log('c', c); //cc
  5. }
  6. a.call({a:'aa'}, 'bb','cc')
  7. a.apply({a:'aa'}, ['bb','cc'])
  1. bind
    1. function a(){
    2. return this.hello === 'world' // true
    3. }
    4. var b = a.bind({hello: 'world'})
    5. b()