set

fun set(index: Int, value: Any? = definedExternally)(source)

MDN Reference