JavaScript, transform object into array

前端 未结 9 1929
孤城傲影
孤城傲影 2020-12-14 15:58

I\'ve got an object:

var obj = {
    \"Mike\": 24,
    \"Peter\": 23,
    \"Simon\": 33,
    \"Tom\": 12,
    \"Frank\": 31
};

I want to cr

9条回答
  •  [愿得一人]
    2020-12-14 16:19

    Some libraries have something to do this (such as prototype's "values" function), but they're really just wrappers around a function that loops over and returns the values of the object.

    http://www.prototypejs.org/api/object/values

提交回复
热议问题