扫码关注官方订阅号
上边是我的代码,但是我在输入set(1)的时候总是伴随undefined,但是却存入了,get(1)的时候也是一样出现undefined,但是取不到值,只有输入localStorage.getItem(1)的时候才能取到,有人知道为什么吗?求帮助
你函数没返回值当然是undefined
function set(Key) { return localStorage.setItem(Key, "demo"); } function get(Key){ return localStorage.getItem(Key); }
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
你函数没返回值当然是undefined