Skip to content

Instantly share code, notes, and snippets.

@coderdiaz
Created May 12, 2015 22:39
Show Gist options
  • Save coderdiaz/5d43f324a6ef93265773 to your computer and use it in GitHub Desktop.
Save coderdiaz/5d43f324a6ef93265773 to your computer and use it in GitHub Desktop.
Obtener el tamaño de un objeto a partir de sus llaves
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