在 Kotlin 中使用 eval 关键字

Use of eval keyword in Kotlin

在 kotlin 中的安全转换和智能转换期间,eval() 有什么用?

它是否类似于我们在 javascript、python 或任何其他语言中使用的 eval()

eval() function is only available in Kotlin/JS , and simply calls the JavaScript eval() 函数。

这意味着您不能在 Kotlin/JVM 或 Kotlin/Native 上 运行 的代码中使用它。

(此外,虽然我不熟悉 Kotlin/JS,但我认为它可能非常强大,也非常危险,因此可能需要谨慎......)