1 Star 0 Fork 0

xinyi/xicha-lottery

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
utils.js 750 Bytes
一键复制 编辑 原始数据 按行查看 历史
18630773023 提交于 2024-08-15 12:22 . init
export const getBaseNum = () => {
const baseMaxNum = localStorage.getItem('baseMaxNum') || 74;
const numbers = Array.from({ length: Number(baseMaxNum) }, (_, i) => i + 1);
const paddedNumbers = numbers.map(num => num < 10 ? `0${num}` : num.toString());
const finishedLottery = localStorage.getItem("finishedLottery") || [];
return paddedNumbers?.filter(x => !finishedLottery.includes(x));
}
export const setFinishedLottery = (threeLottery) => {
const finishedLotteryBase = localStorage.getItem("finishedLottery") || '';
const finishedLottery = finishedLotteryBase?.split(',');
localStorage.setItem(
"finishedLottery",
Array.from(new Set(finishedLottery.concat(threeLottery)?.filter(x => x)))
);
}
export const TIMENUM = 1;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xinyi-codeing/xicha-lottery.git
git@gitee.com:xinyi-codeing/xicha-lottery.git
xinyi-codeing
xicha-lottery
xicha-lottery
master

搜索帮助