打印发现function toUpperCase() { [native code] }

var s='hello'
undefined
s.toUpperCase
function toUpperCase() { [native code] }
s.toUpperCase()
"HELLO"

咦 然后我就发现了 要是这本来是一个方法 然后你没有用一个方法的方式去调用,就会出现function toUpperCase() { [native code] }

类似于这一句

就是这样啦

然后你再用方法的方式去调用一下就会得到你想要的东西

原文地址:https://www.cnblogs.com/lwwen/p/6140576.html