7 kyu

Get key/value pairs as arrays

7,136 of 10,686jhoffner

Description:

Complete the keysAndValues function so that it takes in an object and returns the keys and values as separate arrays.

Example:

keysAndValues({a: 1, b: 2, c: 3}) // should return [['a', 'b', 'c'], [1, 2, 3]]
keysAndValues({a: 1, b: 2, c: 3}) # should return [['a', 'b', 'c'], [1, 2, 3]]
keysAndValues({a: 1, b: 2, c: 3}) # should return [[:a, :b, :c], [1, 2, 3]]

Style Points (JS/CoffeeScript only): This kata only tests for data that uses object literal notation (simple objects). For extra style, can you get your method to check for objects that extend their prototype?

Arrays
Fundamentals

Stats:

CreatedApr 4, 2013
PublishedJun 24, 2013
Warriors Trained15529
Total Skips2036
Total Code Submissions33052
Total Times Completed10686
JavaScript Completions7136
CoffeeScript Completions641
Ruby Completions3255
Total Stars87
% of votes with a positive feedback rating91% of 686
Total "Very Satisfied" Votes582
Total "Somewhat Satisfied" Votes87
Total "Not Satisfied" Votes17
Ad
Contributors
  • jhoffner Avatar
  • Just4FunCoder Avatar
  • farhanaditya Avatar
Ad