Bird
0
0

A developer wrote this code:

medium📝 Analysis Q6 of 15
Microservices - Configuration and Secrets Management
A developer wrote this code:
if (featureToggle.isEnabled(betaFeature)) {
  enableBeta();
}

What is the likely error here?
AenableBeta() is undefined
BUsing wrong method name isEnabled
CMissing quotes around feature name string
DNo error, code is correct
Step-by-Step Solution
Solution:
  1. Step 1: Check method argument

    Feature names are usually strings; missing quotes means betaFeature is treated as a variable.
  2. Step 2: Identify error type

    If betaFeature variable is undefined, this causes an error or unexpected behavior.
  3. Final Answer:

    Missing quotes around feature name string -> Option C
  4. Quick Check:

    Feature name must be string literal [OK]
Quick Trick: Feature names need quotes in isEnabled() [OK]
Common Mistakes:
  • Omitting quotes around feature name
  • Assuming method name is wrong
  • Ignoring undefined variables

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes