object bracket notation

PHOTO EMBED

Tue Jun 28 2022 18:57:32 GMT+0000 (Coordinated Universal Time)

Saved by @cruz #javascript

let spaceship = {
  'Fuel Type' : 'Turbo Fuel',
  'Active Mission' : true,
  homePlanet : 'Earth', 
  numCrew: 5
 };

let propName =  'Active Mission';

// Write your code below

let isActive = spaceship['Active Mission'];

console.log(spaceship[propName]);
content_copyCOPY

https://www.codecademy.com/courses/introduction-to-javascript/lessons/objects/exercises/object-property-access-ii