Conditional if else for a range

Just found solution here: Inline conditional for variable's existence
Thks @davidsneighbour too

{{- $socials := .Site.Params.social_item -}}
{{- if eq $.Type "te" }}
  {{ $socials = .Site.Params.social_item_te }}
{{ else }}
  {{ $socials = .Site.Params.social_item }}
{{ end -}}
{{- range $socials }}
  {{- if .link -}}
  <a title="{{- .title -}}" href="{{- .link -}}" target="_blank" rel="noopener"><span class="icon-round themeicon themeicon-{{ .icon }}"></span></a>
  {{- end -}}
{{ end -}}