well this works, ``` val primitive = v[0]!!::...
# getting-started
s
well this works,
Copy code
val primitive = v[0]!!::class.javaPrimitiveType != null
            v.add(
                if (primitive) {
                    when (v[0]!!) {
                        is Int -> 0
                        is Boolean -> false
                        is String -> ""
                        else -> null
                    } as E
                } else {
                    v[0]!!::class.java.newInstance() as E
                }
            )
provided v has an initial index
­čśĽ 1