有这样一个数据结构,使用的时候报Cannot read property 'undefined' of undefined

fangfa(type,state){
var stateMap = {

1: {

    1: '抽烟',

    2: '喝酒',

    3: '烫头'

            },

2: {

    1: '吃',

    2: '喝',

    3: 'piao'

            },

3: {

    1: 'du',

    2: '抽',

    3: '烟'

        },
}
returnstateMap[type][state]
}

image.png

请问为什么会报这个错,怎么解决

待解决 悬赏分:80 - 离问题结束还有 163天14小时57分25秒
反对 0举报 0 收藏 0

我来回答

回答4