Array does not perform a command in swift
I show a simple example
var array = ["x", "y", "z"]
var index = array.indexOf("y")
I get an error '[String]' does not have a member named 'indexOf'
I saw this question but it doesn't help me.
I imported
import UIKit
import Foundation
import AVFoundation
import CoreAudio
import MediaPlayer
import AVKit