Formats a number with a fixed count of decimals.
- Category: JS Number Reference — part of the JavaScript Tutorial on GoCareerGo
- Read the short summary above, then check the linked docs for full syntax/behaviour
- Interview tip: be ready to explain "Number.prototype.toFixed()" in one sentence, then back it up with a tiny example
// Number.prototype.toFixed() — minimal example
console.log("Number.prototype.toFixed()");Tip
Quick recall: "Number.prototype.toFixed()" — formats a number with a fixed count of decimals.