anyone know why a property that we are instantiati...
# javascript
d
anyone know why a property that we are instantiating in a ViewModel class is undefined when we actually try to use it - this property is undefined when we try to use it https://github.com/DavidCorrado/KMPWithWeb/blob/7560f6a9c58dd2a200227764ca6427eee9[…]c/jsMain/kotlin/com/example/kmpwithweb/PokemonList2ViewModel.kt
If we do something like this, everything works as expected/
Copy code
println("The list is ${PokemonListViewModel().getList().toTypedArray()}")
a
For starters, try to make the property public first to use it
d
the property is private, but used inside a public function - is that still an issue in general?
not sure if the compiler has some kind of considerations that are not obvious
a
It would help if you'd show what piece of code does not work