摘要:
JavaScript中用于生成随机数的方法是Math下的random方法: Mmath.random() 函数返回一个从0到1的浮点数,包括0但不包括1, 获取两个数字之间的随机整数,包括最小值和最大值的方法。 function randomNum(minNum,maxNum) { switch(a 阅读全文
2022年5月24日 #
摘要:
使用 拆分-连接替换法替换所有子字符串 <script type="text/javascript"> alert(replaceAll("苹果,男孩,猫,狗,蛋",",","、")); // 苹果、男孩、猫、狗、蛋 function replaceAll(text,find,replace) { 阅读全文