记不住的js知识点

  • 将字符串分割成数组

    1
    2
    3
    4
    function* split(string){
    yield* string
    }
    console.log([...split('nihao')]);

    或者直接使用扩展操作符

    1
    [...'nihao']
  • null表示一个空指针对象,用typeof检测的话是object。

  • true == 1 但是并不等于2.