Created
May 12, 2015 22:39
-
-
Save coderdiaz/5d43f324a6ef93265773 to your computer and use it in GitHub Desktop.
Obtener el tamaño de un objeto a partir de sus llaves
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var var_object = { | |
'one': 'The first key', | |
'two': 'The second key', | |
'three': 'The third key' | |
}; | |
var size_object = Object.keys(var_object).length; | |
console.log('The size is: ' + size_object); // The size is: 3 ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment