Massives node.js



  • [2015-12-13 19:16:08.913] [DEBUG] result - { '1': '76561198188873209',
      '2': '76561198108244487',
      '3': '76561198240424734' }
    

    I have this kind of abundance when trying to process it through forEach.

    users.forEach(function(item, i, arr) {
    
            });
    

    He says there's no such function. What's the problem?



  • The thing is, javascript. { ... } It's not a mass. It's an object.

    One way to circumvent it:

    for (var key in you_object) {
        console.log(key); // Выводим ключ
        console.log(you_object[key]); // Выводим значение
    }
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2