7.
Which JavaScript function is used to convert a value to a number?
parseInt()
parseFloat()
Number()
toString()
Correct: A, B, C
In JavaScript, there are multiple functions available to convert values to numbers. The parseInt() function is used to parse and convert a string to an integer, while the parseFloat() function is used to parse and convert a string to a floating-point number. The Number() function is a more versatile function that can be used to convert various types of values (strings, booleans, null, undefined) to their corresponding numeric values. By using these functions, we can perform mathematical operations or comparisons with numbers that were originally in a different format.