JavaScript Number Methods & Non-Primitive Data Types Explained

📘 Day 64: JavaScript Number Methods & Non-Primitive Data Types 🔹 toFixed() – Rounds numbers to a fixed number of decimal places • Adds zeros if decimals are not present • toFixed(0) rounds to nearest whole number • Rounds up or down based on decimal value 🔹 toPrecision() – Sets the total number of digits in a number • Controls overall number length, not just decimals • Useful for formatting numeric output 💡 Non-Primitive Data Types: • Array – Stores multiple values in one variable • Object – Stores data in key–value pairs • Map – Collection of keyed data (any data type as keys) • Set – Collection of unique values #JavaScript #Day64 #WebDevelopment #FrontendDevelopment #CodingJourney #JSBasics #LearningJavaScript #NumberMethods #NonPrimitiveDataTypes

To view or add a comment, sign in

Explore content categories