iterate through a map in javascript

后端 未结 5 1591
温柔的废话
温柔的废话 2021-02-01 13:13

I have a structure like this:

var myMap = {
    partnr1: [\'modelA\', \'modelB\', \'modelC\'],
    partnr2: [\'modelA\', \'modelB\', \'modelC\']
};
5条回答
  •  别那么骄傲
    2021-02-01 13:47

    I'd use standard javascript:

    for (var m in myMap){
        for (var i=0;i

    Note the different ways of treating objects and arrays.

提交回复
热议问题