需求:统计n个随机数出现的次数 思路: 通过对象来查看出现的次数 let num, arr, obj; // 定义三个变量 function randomNumber(n) { // 定义一个函数 arr = []; // 定义一个空数组 obj = { };