const options = apple banana orange kiwi grape; var i = -1;function randomSelect const randomIndex = MathfloorMathrandom optionslength; ifi!==-1 ifi == randomIndex alert调用函数+i; randomSele
输出undefined的原因可能是因为在调用randomSelect函数时没有使用console.log()或者return语句来输出返回值。在调用该函数后,需要使用console.log()或者return语句来输出函数返回的值。
原文地址: https://www.cveoy.top/t/topic/cgRT 著作权归作者所有。请勿转载和采集!