Convert a single level object to an array - Node.js Array

Node.js examples for Array:Convert Array

Description

Convert a single level object to an array

Demo Code


/**// w w w.j  a  v  a  2s .  c om
 * Convert a single level object to an array
 * @ignore
 * @api private
 */
exports.objectToArray = function(object) {
  var list = [];

  for(var name in object) {
    list.push(object[name])
  }

  return list;
}

Related Tutorials