Swift - FunctionsWhy are functions considered first-class citizens in Swift?ABecause functions can be assigned to variables and passed as argumentsBBecause functions cannot return valuesCBecause functions must always be declared globallyDBecause functions cannot be nested inside other functionsCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand what first-class means in SwiftFirst-class means functions can be treated like any other value, such as assigned to variables or passed around.Step 2: Identify the correct property of functions in SwiftSwift allows functions to be stored in variables and passed as arguments, which matches the definition of first-class citizens.Final Answer:Because functions can be assigned to variables and passed as arguments -> Option AQuick Check:Functions as values = Because functions can be assigned to variables and passed as arguments [OK]Quick Trick: Remember: first-class means functions act like normal values [OK]Common Mistakes:Thinking functions cannot be passed as argumentsBelieving functions must be global onlyAssuming functions cannot return values
Master "Functions" in Swift9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Swift Quizzes Collections - Array creation and type inference - Quiz 13medium Control Flow - Guard for early exit pattern - Quiz 2easy Control Flow - Switch statement power - Quiz 14medium Data Types - Tuples for grouped values - Quiz 7medium Data Types - Int, Double, Float number types - Quiz 14medium Functions - Nested functions - Quiz 12easy Loops - For-in with where clause - Quiz 12easy Swift Basics and Runtime - Main entry point and @main attribute - Quiz 4medium Swift Basics and Runtime - Why Swift for Apple and beyond - Quiz 10hard Variables and Constants - Var for variables (mutable) - Quiz 5medium