Alternatively you could define an extension method...
# javascript
a
Alternatively you could define an extension method
contains
for
Any
and use the usual
in
operator:
Copy code
inline operator fun Any?.contains(p: String): Boolean {
    val obj = this
    return js("p in obj").unsafeCast<Boolean>()
}
👍 2