JavaScriptのコードを実行することができます。
(しかし、require
やprocess
、setTimeout
やdiscord.jsのモジュールなどは使用できません。)
Replitではそのまま使用することが(たぶん)できます。
他の環境では、index.ts
とworker.ts
をコンパイルした後にindex.js
を実行してください。
^eval const arr = ["apple", "orange", "grape"];
arr[Math.floor(Math.random() * arr.length)]
もしくは、コードブロックで囲むことができます。
^eval ```js
const arr = ["apple", "orange", "grape"];
arr[Math.floor(Math.random() * arr.length)]
```