Skip to content

Instantly share code, notes, and snippets.

@manjufy
Created August 17, 2018 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manjufy/3d2aeda439ba466e0cae6d7d3d651d70 to your computer and use it in GitHub Desktop.
Save manjufy/3d2aeda439ba466e0cae6d7d3d651d70 to your computer and use it in GitHub Desktop.
JavaScript Array is an object
const drivers = ['Vettel', 'Alonso', 'Hamilton']
console.log('Length', drivers.length) // Length = 3
drivers.length = 10
console.log('Length', drivers.length, drivers) // Length = 10
// In Javascript, array is list-like Object
console.log(Object.keys(drivers))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment