Data structures — Objects

  • An Object is a collection of properties and methods.
  • A Property is a key-value pair that contains a name and a value.
  • A Property Name is a unique value that can be coerced to a string that points to a value.
  • A Property Value can be any value, including other objects.
  • Methods are functions that are declared within the object and later on can only be called through this object.
let obj = {
name: 'german',
ladrar: function() {console.log('guau!')}
}
obj.name
obj.ladrar()

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store