.toLowerCase not working, replacement function?

后端 未结 5 587
感动是毒
感动是毒 2020-12-29 01:14

The .toLowerCase method is giving me an error when I try to use it on numbers. This is what I have:

var ans = 334;
var temp = ans.toLowerCase();         


        
5条回答
  •  被撕碎了的回忆
    2020-12-29 01:40

    Numbers inherit from the Number constructor which doesn't have the .toLowerCase method. You can look it up as a matter of fact:

    "toLowerCase" in Number.prototype; // false
    

提交回复
热议问题