FirstOfAll plz幫助我提供在不同對象中使用valueOf方法的信息。在不同對象中使用valueOf方法
有String.prototype.valueOf
和 Object.prototype.valueOf
方法之間的差異,如爲什麼 當沒看見Object.prototype.valueOf.call("maizere")
。既然這裏的valueOf是Object.prototype
不String.protototype
方法存在差異,但它輸出字符串,而不是[object String]
.Shouldn't它輸出[object String]
?看來,如果該方法與valueOf方法屬於String.prototype
因爲它輸出串。感謝ü烏拉圭回合的幫助
'Object.prototype.valueOf === String.prototype.valueOf' ='false'。 – Blender
@ElliotBonneville no,{}。valueOf()返回數組,即[object Object] –
@Blender在這裏有必要嗎? –