MCQ Practice Single Best Answer Topic: Scripted Media

Q What would the following JavaScript code produce?

<script>
// var num = new Number(1000000).toLocaleString("fi-FI");
// document.write(num);
</script>

Question ID
#5041
Subchapter
Scripted Media
Action
Choose one option below

Choose Your Answer

Click an option to check whether your answer is correct.

  • A
    
    1 000 000
    
    
  • B
    
    1 0 00000
    
    
  • C
    
    100 000 0
    
    
  • D
    
    Undefined
    
    
Correct Answer: A

Explanation

The toLocaleString() method formats a number into a string using language-specific formatting. In this example, we use the "fi-FI" value to specify the Finnish locale.
The ttoLocaleString() method converts a number into a string using language-specific formatting. In this case, we use the "fi-FI" value to indicate the Finnish locale.
This method converts a number into a string using language-specific formatting. In this example, we use the "fi-FI" value to specify the number format in FINLAND.
The toLocaleString() method formats a number into a string using language-specific formatting. In this example, we use the "fi-FI" value to specify the Finnish number format.

Share This Question

Share this MCQ with your friends or study group.