Why do you sometimes make mistakes when using toFixed?

var astat1100.2222;
return a.toFixed (2);

vue.js:584 [Vue warn]: Error in render: "TypeError: a.toFixed is not a function"

Mar.04,2021

I wonder, is Number.prototype.toFixed rewritten somewhere?

// ... 
Number.prototype.toFixed = null;
// ...

var a = 1100.22222; 
console.log(Number.prototype.toFixed); // 
a.toFixed(2); // 
The

complete code to see whether this is a development mode or a production mode


encountered a similar problem with Anglar before, when someone rewrote the prototype method.

Menu