Unity C# | Array of ints - does not exist in the current context : I try to make an array of ints:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    
    public class Test : MonoBehaviour
    {
        int[] levelsSolvedCounter = new int[3];
        levelsSolvedCounter[0] = 10;
    }

But I get an error "The name 'levelsSolvedCounter' does not exist in the current context", although in online compiler (https://dotnetfiddle.net/) the code works just fine.