Javascript 什么';这是等效的String.prototype吗/;String.prototype==字符串//假的
我在下面试过了 它按预期运行Javascript 什么';这是等效的String.prototype吗/;String.prototype==字符串//假的,javascript,ecmascript-5,Javascript,Ecmascript 5,我在下面试过了 它按预期运行 String.constructor === Function; //true String.prototype.constructor===String; //true String.prototype === String; //false 它没有像预期的那样工作 String.constructor === Function; //true String.prototype.constructor===String; //true
String.constructor === Function; //true
String.prototype.constructor===String; //true
String.prototype === String; //false
它没有像预期的那样工作
String.constructor === Function; //true
String.prototype.constructor===String; //true
String.prototype === String; //false
我想知道★★. 什么是等效的String.prototype?
其他问题 这是一个独特的对象 它是一个“String.prototype==String.prototype;”是 它与下面的意思相同吗
String.prototype===String.prototype.constructor.prototype; //true
每个函数(
String
是一个函数)都有自己的“唯一的”prototype
对象。因此没有等价物。String.prototype
是一个包含所有String方法的对象。不清楚你到底在问什么typeof String.prototype==“object”
唯一能满足身份测试的是String.prototype===String.prototype
,因为它是唯一的对象。