当 key 对应的存储值等于 '1' 时返回 true 适用于简单的功能开关检查
key
'1'
true
存储键
值为 '1' 时返回 true,否则返回 false
false
setStorage('featureA', '1')hasKeySwitch('featureA') // truehasKeySwitch('featureB') // false Copy
setStorage('featureA', '1')hasKeySwitch('featureA') // truehasKeySwitch('featureB') // false
当
key对应的存储值等于'1'时返回true适用于简单的功能开关检查