反正我是猜错,关于javascript包装对象的一个坑

function fn() {
    console.log(typeof this == 'string');
}
fn.call('str');    // consoler: true还是false?false!

why?

function fn() {
    console.log(this);
}
fn.call('str');    // String{0: "s", 1: "t", 2: "r"}

this是一个字符串包装对象。

原文地址:https://www.cnblogs.com/MyNameIsJim/p/3541376.html