I found another method without depending on the index var which might be at times a string when having a dictionary, and also with being able to sort array…
{{ $.Scratch.Set "counter" 0 }}
{{range sort .Params.employees}}
{{ $.Scratch.Set "counter" (add ($.Scratch.Get "counter") 1) }}
I am the number {{$.Scratch.Get "counter"}} in loop!
{{end}}