You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?
37
+
//ANS:
38
+
//This expression is performing Data Cleaning and Type Conversion.
39
+
carPrice.replaceAll(",","")// This finds every comma in the string "10,000" and removes it, resulting in the string "10000".
40
+
41
+
Number(...)//This takes that cleaned string and converts it into an actual Number data type.
42
+
43
+
//The Purpose: Computers cannot perform mathematical calculations(like division or subtraction) on strings that contain formatting characters like commas.
0 commit comments