Bird
0
0

What is wrong with this pipe usage?

medium📝 Debug Q7 of 15
Angular - Pipes
What is wrong with this pipe usage?
{{ amount | currency:'USD':'true' }}
APipe name is misspelled
BCurrency pipe does not accept parameters
CThe second argument 'true' is not a valid display option
Damount must be a string, not number
Step-by-Step Solution
Solution:
  1. Step 1: Check currency pipe parameters

    The currency pipe's second parameter expects 'code', 'symbol', 'symbol-narrow' (string), or boolean for display style; the string 'true' is invalid.
  2. Step 2: Identify the error

    Passing 'true' (invalid string) causes an error.
  3. Final Answer:

    The second argument 'true' is not a valid display option -> Option C
  4. Quick Check:

    Pipe parameters must match expected values [OK]
Quick Trick: Check pipe parameter types and values carefully [OK]
Common Mistakes:
  • Passing wrong parameter types
  • Assuming pipes accept any argument
  • Ignoring pipe documentation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes