0

I have an Array() of Object()s with keys firstKey and secondKey.

Does a function exist that can set a var equal to an Array() of all of firstKeys' values only?

If so, what is it? Libs & plugins welcome.

1 Answer 1

2

You can use the Array.map() function:

var newArr = objects.map(function(w){ return w.firstKey; });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.