Kotlin Sort Array Javascript Append