-1
<script type="text/javascript">
var a = new Array(
"Jane",
"Tom,",
"Alan,",
"Mary");
</script>
<script type="text/javascript">
document.write(a[Math.floor(Math.random()*a.length)]);
</script>
ate an apple
稍后在脚本中是否有重复使用(a[Math.floor(Math.random()*a.length)])
的答案?如何重用随机结果?
因此,举例来说,我可以在以后使用文本一起的Harry asked "answer" if they had enjoyed the apple