策略模式,es6中 ?? 的用法 const judge = function(status){ const map = [ 0: '普通用户', 1: '管理员', 2: '超级管理员' ] return map[status]??'未知用户' } ?? 是ES6提供的一个操作符,被称为非空运算符 Read More
posted @ 2023-03-23 14:20 梓色心晴 Views(58) Comments(0) Diggs(0) Edit