PRACTICE / UNDERSTAND / REPEAT

Go practice question

Practice declarations with self-contained questions. Check your answer, then use the explanation to understand the reasoning.

1 questionAnswers explainedFree · no login

Try this question

Declarations · MCQQuestion link ↗

Inside a function, which operator declares and initializes `count`?

Choose one answer
Answer & explanation

Answer: :=

Go’s short declaration operator is `:=`; plain `=` assigns to an already-declared variable.