8. Format Currency

Write a function `formatCurrency` that takes a number and a currency code (like 'USD', 'EUR', 'JPY') and returns the currency formatted string using international formatting rules.

Examples:

Input: formatCurrency(1234.56, 'USD')
Output: "$1,234.56"
Explanation: Formatted using USD standards.
Input: formatCurrency(1234.56, 'EUR')
Output: "€1,234.56"
Explanation: Formatted using EUR standards.
SolutionJavaScript
Test Results
Click "Run Code" to test your solution