How would I write the code below in function form?
var obj = {
name : 'Tim',
age : 20,
hasPets : false
};
console.log(Object.keys(obj).map(function(item){
return obj[item];
})); //=> [ 'Tim', 20, false ]
For example--this type of function form:
function objectToArray(obj) {
//code here
};
Thank you!